Mural on Indian Red Ground was seized by the country's customs service on 11 May after being on loan to Japan.
The service said it confiscated the work over money owed by the Ministry of Culture, which runs the museum.
The ministry said the painting had been returned "after negotiations".
The artwork was on its way back to Iran from the National Museum of Modern Art in Tokyo, where it was displayed in an exhibition celebrating the centenary of the artist's birth.
The Islamic Republic of Iran Customs Administration seized it at the Imam Khomeini International Airport due to the culture ministry's reported delay in repaying its debts.
Mural on Indian Red Ground is considered one of the prize pieces in the Tehran museum, which also features works by Gauguin, Picasso and Sir Henry Moore.
Most of the collection was built up by Iran's former queen Farah Pahlavi, who deployed a team of experts to tour Western auctions and buy prestige paintings and sculptures to boost her country's cultural profile.
LWDLIK - Anyone else surprised that the Tehran Museum has a $250 million Jackson Pollock? And I wonder if the Gaugin is one of his famous Tahitian topless ladies?