An unnamed man has been arrested after attempting to leave Australia hidden in the air conditioning vent of a bulker.

The vessel had earlier come to the assistance of a yacht that had encountered trouble off the coast of Newcastle, according to the Australian Border Force (ABF).

The ship attached a tow line to bring the yacht towards the Newcastle offshore anchorage and a 31-year-old man, who had been onboard the yach t, was taken into a cabin on the bulker.

As the ship entered Newcastle, it was discovered the tow line carrying the yacht had snapped – with the yacht lost in the process – and the 31-year-old man was missing.

“Officers from the Marine Area Command commenced an extensive search of the area that day; however, the man was not located,” the ABF said.

“When the ship anchored at Newcastle, NSW Police and Australian Border Force (ABF) officers, with the assistance from the Dog and Mounted Command, conducted an extensive search onboard the bulker.”

Eventually, NSW Police and ABF officers are said to have located the 31-year-old man inside an air-conditioning vent on the ship.

He was reported to be carrying a knife and about AUD 4,400 ($3,050) in cash, police said.

Subsequent checks are said to have revealed that the man was in breach of his bail over an alleged sexual assault and he was arrested.

Police authorities claim the man had deliberately cut the tow line and planned to hide onboard the ship until it was due to depart Newcastle for Malaysia.