A former Australian Army officer who sexually assaulted a colleague with a beer bottle during "hijinks" at a work function will spend three months in jail, be demoted from his rank as captain, and be kicked out of the Army.

Key points: Assault happened during "hijinks" in the men's toilets at a work function

Assault happened during "hijinks" in the men's toilets at a work function Boyson is dismissed from the Army and jailed for three months

Boyson is dismissed from the Army and jailed for three months Victim suffers "ongoing anxiety" over the rape

Rhiley Boyson, 26, assaulted the man in the men's toilets at the social event last year — in what his lawyer described as "tomfoolery gone wrong".

While all parties conceded the attack did not have a sexual motivation, Boyson was found guilty of raping the man earlier this week.

The court martial panel that sentenced Boyson heard the victim had been lying on the ground, trying to prevent his pants from being removed when Boyson violated him with a beer bottle.

Boyson has been taken to Holsworthy Barracks to be detained, pending an automatic review, before any transfer to a civilian jail would occur.

Judge Advocate Brigadier Michael Cowen said the sentencing from a court martial panel was similar to the civilian courts, but must also take into account the maintenance of Australian Defence Force discipline.

He said the assault occurred against the backdrop of a push to change military culture.

"There were some hijinks going on it the toilets at the time," he said.

The court heard the victim suffers ongoing anxiety and trauma over the attack.

Earlier in the proceedings, prosecutor Sarah Robin told the court martial panel a strong message needed to be sent over the assault.

"A message needs to be sent to him that pranks that result in a violation of the person will not be tolerated," she said.

Boyson's lawyer Flight Lieutenant Sophie Callan said his actions were a "momentary lapse" that would have lifelong consequences.

"This was an instance of momentary penetration, a few seconds long," she said.

Boyson has the option to appeal the court martial's decision.