He has also fined over 2 million euros (USD 2.2 million) for not paying three counts of tax.
A court statement on Wednesday said the sentence could be appealed through the Spanish Supreme Court.
The court also gave his father, Jorge Messi, a jail term for defrauding Spain of €4.1m (£3.5m; $4.5m) between 2007 and 2009.
Messi’s image rights reportedly include endorsement deals with Danone, Adidas, Pepsi-Cola, Procter & Gamble as well as Kuwait Food Company.
However, because this was the first time the Barcelona forward had committed an offense and his sentence was less than two years, the 29-year-old Messi won’t serve jail time as long as he doesn’t break the law again.
Under the Spanish system, prison terms of under two years can be served under probation.