Barcelona confirmed in a statement after the announcement that they would appeal the ban.
Referee Jesus Gil Manzano was alerted to the incident by VAR and after watching a replay on the pitchside monitor decided to give Messi his marching orders.
The Royal Spanish Football Federation's competition committee met on Tuesday and deemed the challenge to be worthy of a two-game suspension.
Messi will miss Thursday's trip to third division Cornella in the Copa del Rey and Sunday's La Liga game away at Elche. Should Barca beat Cornella, he will return for a potential round-of-16 tie in the Copa del Rey next week and will also be available for the league match at Camp Nou against Athletic, who beat Barca in Sunday's final, on Jan. 31.
Messi had only previously been sent off three times in his professional career and only once at club level. His first red card came in February 2005 in a league game for Barca B against Pena Sport.
He was expelled for his protests after not being awarded a penalty in the final 10 minutes of the match.
However, he had never been sent off for Barca's senior side until Sunday, with his first red card for the club arriving in his 753rd official appearance.