Bayern Munich have confirmed that Rafinha has extended his contract at the club until the summer of 2017.
The Brazilian moved to the Allianz Arena back in 2011, but seemed certain to leave the club just a few months ago after two disappointing seasons in Bavaria.
However, the arrival of new coach Pep Guardiola, along with Philipp Lahm's switch to midfield, has seen him take on a first-team role this term; and the former Schalke man is delighted to have committed his future to the club.
"It's very important to me, my career and my family that I continue to work for one of the best clubs in the world. I am very proud," the 28-year-old told the club's official site.
Chief financial officer Jan-Christian Dreesen, who led the negotiations, says it was important to tie Rafinha down in the long term.
"Rafinha is not only a good player on the pitch, but a great character in the dressing room. He has received a boost under Pep Guardiola and is doing his job again," he continued.
Bayern face Raja Casablanca in the Club World Cup final on Saturday and Rafinha is hoping to add another medal to his collection.
He added: "It's a dream to play in this final. We really need to play well to win."
Rafinha's previous deal at Bayern was due to expire in June 2014.