The Malaysian Grand Prix will be dropped from the Formula 1 calendar next year, after a joint decision was made with grand prix chiefs to end its deal early.

The long-term future of the Sepang event had been in doubt for several months, after government ministers announced last November that they would not fund an extension of the original deal that ran to the end of 2018. The decision to not continue with F1 was based on the high costs of holding the event, allied to low ticket sales.

However, following discussions with new F1 owners Liberty Media, a deal has been reached for the contract to be terminated after this year's race – with the event being replaced by the returning German Grand Prix in 2018.

F1's managing director of commercial operations Sean Bratches said in a statement: "It's always sad to say goodbye to a member of the Formula 1 family.

More for the German G:

"Over nearly two decades, the Malaysian Formula 1 fans have proven themselves to be some of the sport's most passionate supporters. As we said in Melbourne, we have big plans for bringing our global fan base closer to the sport than ever before, providing an enhanced digital experience and creating new events. We're looking forward to talking more about these plans as the season progresses."

"We will have 21 exciting events to look forward to in the 2018 calendar, with the additions of the French and German races. I'd like to take this opportunity to thank the Sepang International Circuit for their hospitality and professionalism over the years, and their ongoing commitment to motorsport."

Although Malaysia has not been able to make a success of its F1 race, the track remains fully committed to MotoGP – which has attracted bumper crowds and generates a profit for the circuit.