RB Leipzig and coach Ralph Hasenhuttl have parted ways after failing to agree on a contract extension beyond next season.

The 50-year-old leaves the Bundesliga side after finishing sixth in the club's second season in Germany's top tier. On Wednesday, Leipzig and Hasenhuttl signed a mutually agreed contract termination, the Bundesliga club announced.

"I would have liked to go into the new season with Ralph Hasenhuttl as our head coach," RB sporting director Ralf Rangnick said in a statement. "I came to the realisation that another year together to begin with would have been sufficient. For Ralph however, there was no alternative to a premature contract extension. It was his explicit wish to terminate the contract and we accepted that with a heavy heart.

"In the past few season, Ralph has been incredibly impressive with a huge contribution and put in a lot of work. I don't see Ralph as just a very talented coach but he's also an incredible person. From the bottom of my heart, I wish him all the best for the future, both professionally and privately."

Leipzig CEO Olaf Mintzlaff thanked Hasenhuttl for his services but said "a contract extension at this time would not have been the right step for this club."

And Hasenhuttl said he understood why Leipzig wouldn't want to extend the contract at this time.

"However, we emphasised that it wouldn't be ideal for either side to head into a final year of my contract [without] clarity regarding my long-term future," he said. "In my eyes, a sustainable contract solution is of great significance for the implementation of RB Leipzig's long-term aims.

"After successes together, you should be able to able to be honest and choose a clear no over a reassuring yes. For this reason, I asked the powers that be to end our co-operation prematurely. Thank you for your generous support to all my colleagues, the partners and the fans. I'll never forget my time in Leipzig."

BREAKING 🔴⚪



RB Leipzig have granted Ralph #Hasenhüttl's wish to terminate his contract with #DieRotenBullen prematurely. The club had hoped to continue working with our head coach until his current contract ended in summer 2019. pic.twitter.com/uD3UKdJMYd — RB Leipzig English (@RBLeipzig_EN) May 16, 2018

Having joined Leipzig from Ingolstadt in 2016, Hasenhuttl took the Bundesliga by storm as his side finished runners-up to Bayern Munich in their maiden season in Germany's top flight.

However, arriving at the top of the German pyramid also meant the club also had to cope with players wanting to make the next step at bigger clubs. Last summer, Guinea midfielder Naby Keita agreed to join Liverpool after the 2018 World Cup.

Sweden international Emil Forsberg also wanted out, but Leipzig did not allow him a transfer as they headed into their first Champions League season.

With 18 months left on the deal, Hasenhuttl and Leipzig watched each other furtively from the winter break on. Both sides at different stages claimed they wanted to prolong the contract, but talks were delayed until after the season.

In early May, Hasenhuttl confirmed on ZDF TV that he was contacted by Bayern Munich earlier this year as the Bundesliga champions were settling upon Jupp Heynckes's successor.

In April, Mintzlaff said on Sport 1 that they were "a bit fed up" with rumours linking Hasenhuttl to other clubs. "We have always said that we will go into the new season with him."

Hasenhuttl has also been linked with Borussia Dortmund, who are expected to announce Lucien Favre as their new coach once the Ligue 1 season ends at the weekend.