The Brazilian appeared to have been discarded from coach Jose Mourinho's plans and the arrival of fellow playmaker Luka Modric from Tottenhan was interpreted by many as the final nail in the coffin of his undistinguished stint in the Spain capital.
Linked in the media with moves to former club AC Milan or Paris St Germain, he only made his first appearance of the campaign on Sunday, coming off the bench in Real's 5-1 La Liga win at home to Deportivo Coruna, their ninth game of the season.
However, Mourinho surprised many by including Kaka in the starting lineup for Wednesday's 4-1 Champions League win at Ajax and he responded with a performance full of verve and creativity that suggests he may be working his way back into contention.
"I was surprised to be starting," Kaka told reporters after the match at the Amsterdam Arena, during which he provided a delightful assist for Karim Benzema's breathtaking 48th-minute overhead kick and came close to scoring several times himself.
"I found out in the afternoon but at Real Madrid we all have to always be prepared to play," he added. "I had a very bad time. Starting games is a personal goal and if I work hard things will come good."
After consolidating their position at the top of Champions League Group D on six points from two matches, Real play at Barcelona on Sunday.
A victory for Barca in the La Liga 'Clasico' at the Nou Camp will stretch their lead over the bitter rivals to 11 points and Kaka said he was ready to play if selected in a match which could go a long way to deciding the championship.
Mourinho said his decision to initially leave Mesut Ozil on the bench on Wednesday before deploying the German playmaker in place of Kaka for the final 15 minutes was "nothing definitive".
"I decided that with his (Kaka's) characteristics, the nature of the opponent and the work he did during the week, it would be good for us if he played against Ajax," the Portuguese told a news conference.
"The media thinks every time a player of status is on the bench it's a big problem," he added.
"My job is to think about who will play and to tease out the best performances. I have to choose 11 players and there will always be someone left out."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.