HALIFAX -- A Royal Canadian Navy officer was given a severe reprimand and a $5,000 fine Wednesday for deserting his post on a supply vessel after alleging he faced harassment and ridicule.

Lt. Derek de Jong told his court martial that prior to deserting on Sept. 17, 2012, he was subjected to deplorable behaviour that included a female colleague urinating in his cabin. HMCS Preserver was docked at Key West, Fla., when he left the ship.

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 sentence for desertion under the National Defence Act is life in prison, although in this case the prosecution and defence agreed the maximum sentence was five years because de Jong wasn't considered to be on active duty.

Speaking outside court, de Jong said he felt the sentence was just.

"The sentence was very fair. ... In fact I feel the courts were more than fair. I had assumed the penalty would be greater than a severe reprimand and $5,000," he said.

"As the judge said, I'm being given a second chance. I hope I can re-earn the respect of those appointed under me."

Military judge Col. Michael Gibson agreed with prosecution and defence arguments that a prison term would be too harsh.

He also said it is completely unacceptable for a senior officer to "pick up their marbles and go home" when confronted with adversity while on duty.

The judge 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. Instead, you chose to run away," said Gibson.

During the court martial, defence lawyer Major Sara Collins argued that de Jong, 43, had an "impeccable" service record and the unqualified support of his superior officer.

The agreed statement of facts in the case says de Jong signed a letter to his commander on the day of his desertion. It says he had been working in a toxic environment and that he had visited the sick bay and requested to be sent back to Canada for medical reasons.

The statement says despite attempts by a senior officer to persuade him to stay, de Jong left the ship in civilian clothes. He flew back to Halifax where he turned himself in to military police.

During testimony earlier this week, de Jong said his decision to leave was wrong and he feels remorse for it.

He said a medical examination completed after he returned to Canada indicated he was suffering from excessive stress and a heart condition.

De Jong said its possible his complaints of harassment will be dealt with in a separate process.

"As there may be other disciplinary measures that come out of this case, other matters that would be before the courts and I would likely be a witness to those it's probably not warranted I say anything at this time," he said outside court.