The 31-year-old Argentina international, who joined Barca in August 2010, pleaded guilty last year to defrauding the Spanish tax authorities of more than 1.5 million euros by concealing earnings from his image rights by using companies set up in the United States and Portugal.
During a brief appearance in court on Thursday, he agreed to pay an 800,000 euro ($870,000) fine and cover the legal costs, the newspaper El Pais reported. Sentences shorter than two years are not usually enforced in Spain.
Mascherano also paid back the unpaid tax plus almost 200,000 euros in interest.
In a tweet, Mascherano acknowledged the plea bargain, and said he reserved the right to take legal action against those who had given him poor advice on his personal finances.
Mascherano's Barcelona and Argentina team mate Lionel Messi, FIFA's world footballer of the year, is due to appear in court with his father at the end of May to answer charges of tax fraud.
Image: Barcelona defender Javier Mascherano.
Photograph: David Ramos/Getty Image
Dubai policeman in trouble for revealing Messi's passport online
Barca ease into King's Cup quarters with derby win
'She took a stand in Gujarat when few had the courage'
Spate of injuries hit Barca and Real Madrid: Problems for Messi, Bale
Barcelona dominate UEFA's 2015 Team of the Year