The head of state added his voice to warnings after Spain's conservative prime minister, Mariano Rajoy, sharpened his tone against Catalan nationalists.
"Public authorities are subject to the rule of law, and it is by respecting it that they guarantee the orderly functioning of the state," the king said.
"Respect for the law is the source of legitimacy and an unavoidable requirement for living together democratically in peace and freedom."
He did not refer to Catalonia or independence in his remarks, although they were made in an address in Barcelona where Catalonia's pro-independence regional president, Artur Mas. was present.
Political leaders in Catalonia, a rich northeastern region of Spain, have formed an alliance to campaign for independence in a regional election in September.
Rajoy is due to fight for re-election in national polls around November. Catalonia is the most sensitive political issue facing him as he tries to cement Spain's recovery from recession.
His government fiercely opposes independence for Catalonia, which wants to follow Scotland's example by voting on its political future.
On Monday the leader of the Catalan pro-independence electoral list, Raul Romeva, said separatists were ready to declare unilateral independence if Madrid tried to block its efforts.
Rajoy reacted sternly to that, saying it would be "a head-on attack on the law".
"The government will not allow it and is prepared for any problem that anyone might cause in the future," he said on Tuesday.
Since taking the throne in June 2014, Felipe, a symbol of the unity of Spain and its diverse regions, has issued discreet calls for unity over Catalonia.
Tensions peaked last November when its regional president Artur Mas defied Rajoy by holding a symbolic vote on independence, and are rising as the official regional vote is planned for September 27th.