The defendant pleaded guilty to posting six messages on Facebook that contravened Thailand's strict lese-majesty laws.
"It is the longest sentence handed out for such a case," said Poonsuk Poonsukcharoen from advocacy group Thai Lawyers for Human Rights.
The ruling junta have used military courts to prosecute lese-majesty cases as the army considers the matter to be one of national security, Poonsuk said.
She added that a military court was likely to hand out harsher sentences than its civilian counterpart for such crimes.