Mohammed Abdiwali, who molested a sleeping woman, still wants to get home to Somalia, the Palmerston North District Court heard.

A Somalian man who violated a sleeping woman in an effort to be deported is back in jail, just days after his release.

Mohammed Abdiwali​ pleaded guilty in the Palmerston North District Court on Tuesday to breaching his release conditions, imposed after he was released from prison on January 10. He didn't go to an appointment he was required to.

He was jailed in 2014 for five years and nine months after committing a sexual violation during a burglary in Te Puke.

He climbed into bed with a woman at the house, who woke to find she was being molested.

READ MORE:

* Man jailed for 15 months for vicious street assault of young boy

* After 15 years a sex offender's wish comes true - parole, and a trip home to Australia

* Refugee considered dangerous enough to deport could soon be back on the streets

He fled with items he stole from the property, including a laptop and alcohol.

According to a report of his sentencing in the Bay of Plenty Times, he committed the offence because he thought he would be deported back to Somalia.

He served his entire jail term, with the Parole Board seeing him for the final time in November to set release conditions.

In its report, the board said Abdiwali completed both drug and adult sex-offender-treatment programmes, and moved into a self-care unit.

But he was taken out of the unit after using cannabis.

A psychological report noted he was a high risk of reoffending and he still thought seriously offending would get him deported.

The board said Abdiwali wanted to return to Somalia to be with his family, but there were immigration problems to work through.

He was not subject to electronic monitoring on release, but was required to attend a psychological assessment, stay off alcohol and drugs, live at a specific property, be home overnight, and not enter Bay of Plenty.

Defence lawyer Gareth Stone told the court on Tuesday Abdiwali was living with a supportive person, but he could no longer live with them.

That meant prison was the only option, Stone said.

Abdiwali still wanted to get back to Somalia, but his release conditions would run until July.

Judge David Smith said Abidiwali's situation would be much easier if he followed the rules.

"You have really made life difficult for yourself."

He sentenced Abdiwali to six weeks' jail, imposed release conditions for another six months, and ordered him to undertake a pyschological assessment and any associated treatment.