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 in the summer 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 website.
Chief financial officer Jan-Christian Dreesen, who led the negotiations, says that it was important to tie Rafinha down for 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 remarked.
Bayern face Raja Casablanca in the Club World Cup final on Saturday and Rafinha hopes to add another medal to his collection.
The full-back enthused: "It's a dream to play in this final. We really need to play well to win."
Rafinha's previous deal was due to expire in June 2014.