Rajoy "came into power during a very challenging time in Spain," said Obama at a press conference after his first official meeting with Mariano Rajoy.
The US president said he had "congratulated the prime minister on the progress that’s been made in stabilizing the economy, moving into growth, reducing the deficit, and being able to return to the financial markets in a way that reflects sound leadership".
But Obama also said Spain, like the US and Europe, still faced "enormous challenges...with respect to bringing down unemployment and increasing growth".
"My view is that Europe as a whole has the ability to grow faster," said the US president in response to a question from a journalist.
"I do think that the work that’s been on strengthening the banking union and banking regulations, financial sector regulations across the continent can also make significant contribution not just in giving markets assurance, but also continuing to guard against some future vulnerabilities that may arise in the eurozone area," he added.
Rajoy also chose to stress the progress made by Europe and Spain over the last 12 months, saying 2013 jobs and growth figures for the country were the best in five or six years.
The Spanish leader reiterated his message that "jobs will be created in Spain in 2014.
Both leaders, meanwhile, stressed the importance of the proposed Transatlantic Free Trade Area (TAFTA) in strengthening the economies of the US and Europe.
They also spoke about international security issues including terrorism, the implications of the civil war in Syria and political instability in Libya.
"I think security cooperation between the United States and Spain has never been stronger," said Obama.
Neither Obama nor Rajoy addressed the issue of NSA spying during their remarks, but Rajoy answered a press query by saying Spain was "satisfied" with explanations provided by the US Ambassador in Madrid.
In 2012, leaked documents from the US National Security Agency revealed that Washington had targeted the communications of countries including Spain, Germany and France.
Rajoy greeted the allegation by saying such spying was "unacceptable", and called in the US Ambassador in Madrid for questioning.
Monday's meeting between the Spanish Prime Minister and Obama received very little coverage in the US press with most coverage focusing on the US president's responses to questions about Afghanistan and Iran during their joint press conference.
Rajoy's meeting with Obama comes a little over two years after the Spanish leader took office — a delay some Spanish media outlets saw a snub.
Barack Obama waited only 10 months after being elected to invite Spain's socialist ex-President José Luis Rodríguez Zapatero for a visit.
While bilateral relations between Spain and the US suffered a blow when Spain decided in 2004 to withdraw troops from Iraq, relations are now said to be on a firmer footing.