BAGHDAD -- Canada's defence minister is visiting Iraq, just days after Canadian military forces helped push back a major Islamic State offensive.

Harjit Sajjan spent Sunday in the town of Irbil in a visit not announced in advance by the Canadian government.

A spokeswoman for Sajjan says the purpose of the trip was to meet with defence and security officials in the region and visit Canadian military personnel.

She says Sajjan met with his Iraqi counterpart in Baghdad and with Kurdish leaders in Irbil.

He met his Egyptian counterpart earlier during a stop in Cairo.

Sajjan's office says the trip was planned before last week's ISIL offensive took place.

On Thursday, Canadian special forces personnel who are in Iraq in a non-combat training role laid down supporting fire to help repulse the ISIL offensive.

Canadian CF-18 fighter jets also pounded an ISIL position near Mosul.

The Trudeau government has announced it intends to withdraw the CF-18s from Iraq sometime in the new year and bolster the training mission.

Sajjan is also scheduled to visit the Canadian warship HMCS Winnipeg during the trip.