"The law and dialogue, these are the ways out of the situation in Catalonia... no one is above the law," Rajoy said, adding: "I want us to stay together."
His comments came a day after Catalan leaders said they would defy a Constitutional Court ruling that provisionally blocked the planned independence referendum on November 9.
Catalan pro-independence parties declared they were "united" on the issue, which threatens to trigger Spain's biggest constitutional crisis in decades.
Fired up by last month's independence referendum in Scotland -- although voters there rejected independence -- hundreds of thousands of Catalans have protested in the streets in recent weeks, demanding their own vote.
Proud of their distinct language and culture, many of Catalonia's 7.5 million inhabitants have long complained they get a raw deal from the government in Madrid, which decides how their taxes are spent.