No financial details of the contract were revealed but Greek media reported that the 49-year-old would receive 900,000 euros ($974,865) plus bonuses each season.
Martins has coached the 44-time Greek champions the last two seasons, and his side finished the regular season unbeaten at the top of the league.
His side awaits the post-season playoffs, which were postponed due to the coronavirus pandemic but are expected to resume soon.
Martins has also led Olympiakos to the last 16 of the UEFA Europa League and to the semi-finals of the Greek Cup.
For more news your way, download The Citizen’s app for iOS and Android.
Download our app and read this and other great stories on the move. Available for Android and iOS.