"The fundamentals of the agreement are done," he told a news conference after meeting opposition leaders to build a united response to a plan from Catalonia's ruling separatists to launch a process that would lead to full independence from Spain within 18 months.
"We are all in agreement on the unity of Spain, we all agree on national sovereignty, we are all in agreement that laws must be respected, we are all in agreement that all Spaniards are equal," he added.
Rajoy, criticized within his own conservative Popular Party for not doing enough to block the separatists, met the leader of new far-left party Podemos, Pablo Iglesias for the first time, as well as the head of center-right party Ciudadanos, Albert Rivera.
The prime minister, who faces a general election on Dec. 20, had already met the head of the main opposition Socialists, Pedro Sanchez, on Wednesday.
Rivera said after his talks with Rajoy that he had proposed a "national pact" against Catalan separatism that would see all major parties agree to defend the country's unity.
"The idea is that Spaniards know that whatever parliamentary majority emerges (after the general election), Spain will not be in play," Rivera added.
Ciudadanos, which was formed in Catalonia to oppose separatism, came second in a Catalan regional election last month behind a coalition of separatists, and polls show it could emerge as king-maker at the national level following the general election.
Pro-independence parties announced Tuesday they would pass a resolution early next month in the regional Catalan parliament calling on the chamber to announce the formal start of secession from Spain and the formation of a new republican state within 18 months.
The motion calls on the regional assembly to start working on legislation within 30 days to create a separate social security system and treasury.
It also says the process would not be subject to decisions made by the Spanish institutions, including the Constitutional Court.
No date has yet been set for the Catalan assembly to vote on the motion.
'Against anti-secession fronts'
Deputy Prime Minister Soraya Saenz de Santamaria said the government will immediately challenge the motion in Spain's Constitutional Court if it is passed.
Pro-independence parties won a majority of seats in the 135-seat Catalan parliament for the first time in elections last month.
But while they topped the poll, winning 72 seats, the pro-independence camp failed to win a majority of all votes cast — a fact emphasized by the central government in Madrid, which has fiercely resisted their push for independence.
Spain has a history of reaching national pacts on key issues. Political parties have in the past joined forces in opposition to attacks by the armed Basque separatist group ETA and after the death of longtime dictator Francisco Franco in 1975 to guide the country to democracy.
Podemos was the only party to be cool on the pact. Iglesias said after his meeting with Rajoy that "he was not convinced by anti-secession fronts" and favored "dialogue."