A five-year extension of Sepang's contract with Dorna Sports was signed earlier on Saturday.
A five-year extension of Sepang's contract with Dorna Sports, MotoGP's commercial rights holder, was signed earlier on Saturday, officials said.
The current contract expires this year.
"I'm happy to inform that we have signed an extension for five years ending in 2021," Sepang International Circuit chairman Azman Yahya told a press conference ahead of Sunday's race.
"We will continue with the MotoGP for the next five years and we think that we will see an even better response from the Malaysian public."
Sepang has hosted the Malaysia Motorcycling Grand Prix since the circuit opened in 1999.
The track expects a record 90,000 spectators for Sunday's sold-out grand prix, up from 85,000 last year, officials have said.
But track CEO Razlan Razali said earlier this week Malaysia may take a "temporary break" from F1 after its current race contract expires in 2018, citing ebbing ticket sales and TV viewership.
"If there is no economic value, why should we continue? We better take a temporary break," he told AFP.
Like MotoGP, the F1 race also has been held since 1999 at Sepang, which is known for its tropical downpours and sauna-like conditions.
The Malaysian F1 is Asia's second-oldest next to the Japanese Grand Prix, which dates back to 1976.
Formula One races are often loss-making but still attractive to many cities because of their prestige and exposure to global audiences.
But Razlan said Sepang, which can accommodate 120,000 fans, drew just 45,000 to last month's Malaysian F1 event and TV ratings were poor.
Sports Minister Khairy Jamaluddin said competition from newer events outside of Malaysia was taking its toll.
"I think we should stop hosting the F1. At least for a while. Cost too high, returns limited," he said on Twitter.
F1 is struggling worldwide, with official figures showing it has shed 200 million TV viewers globally since 2008.
US firm Liberty Media announced a takeover of F1 last month amid hopes that a new leadership and plans for greater US penetration will provide a lifeline.
Malaysia's MotoGP, by contrast, is consistently popular.
"It was not that difficult to convince the government of Malaysia to continue to support the Malaysia (motorcycle) Grand Prix," Razlan said Saturday.
"We achieve record-breaking crowds every year."
Dorna Sports CEO Carmelo Ezpeleta lauded the Malaysian MotoGP as an "incredible spectacle".
"I must say that we are very proud to renew at least for these five years," he said.