A Royal Canadian Navy officer who pleaded guilty to desertion won't be demoted, but will be fined and severely reprimanded for deserting his post on HMCS Preserver after alleging he faced harassment on board.

Lt. Derek de Jong was fined $5,000 on Wednesday after pleading guilty to desertion. He admitted he left his post after he was subjected to deplorable behaviour that included a colleague urinating on his cabin floor.

The defence asked for a reprimand and a fine, while a military prosecutor wanted de Jong reprimanded and demoted one rank to sub-lieutenant. The maximum possible sentence in the case was five years in prison.

De Jong said outside the courtroom he felt the decision was "more than fair."

"I had assumed that the penalty would be greater than a severe reprimand and $5,000. As the judge said, I'm being given a second chance," he told reporters.

"I hope I can re-earn the respect of those appointed under me."

Military judge Col. Michael Gibson said it was completely unacceptable for a senior officer to "pick up their marbles and go home," even if he was being mistreated.

Gibson didn't accept the harassment allegations as a mitigating factor in the sentence, saying de Jong could have pursued other methods to resolve his grievances.

"There are many appropriate mechanisms, but you did not engage them or persist in engaging them," said Gibson. "Instead, you chose to run away."

Sentence will 'send a signal' to military

De Jong testified he left his post aboard HMCS Preserver in September 2012 while ship was docked in the Florida Keys.

The defence argued de Jong, who had an "impeccable" service record, was only AWOL for 30 hours, that his chain of command was informed throughout that time and there were no adverse effects on operations as a result of his desertion.

After leaving HMCS Preserver, de Jong returned to Halifax, turned himself in to military police and began working at CFB Halifax.

Lt.-Cmdr. Darin Reeves, the military prosecutor, said he thinks de Jong's sentence will act as a deterrent.

"It will have a desired effect to send a signal throughout the fleet and throughout the Canadian Forces that desertion is not an acceptable conduct," he said Wednesday.

At a news conference later in the day, Commodore Scott Bishop, the commander of the Atlantic navy fleet, said he heard about the urination incident after de Jong left the ship.

Bishop said "remedial actions" were taken against the accused officer but he declined to give details of what those were. He said the woman is still in the navy.

"We had a process there and it was followed," he said.

Bishop said now that de Jong's court martial is over, the navy can examine his harassment allegations, but officials have not decided whether a full investigation is necessary.

With files from The Canadian Press