The Supreme Court allowed the five men, on trial for their role in Catalonia's 2017 secession attempt, to leave jail to take up their seats, but they are likely to be quickly suspended because of their legal situation.
They won office in an April 28 general election which was won by acting Prime Minister Pedro Sanchez's Socialists but without a majority.
Oriol Junqueras, Jordi Sanchez, Jordi Turull and Josep Rull won seats in the Congress, the lower house of parliament, while Raul Romeva was elected to the Senate, the upper house.
They were greeted with applause from other members of their parties when they arrived.
Like other lawmakers they swore to respect the Spanish constitution — the same constitution they are accused of having violated with their independence push.
Romeva vowed to respect the constitution “as a political prisoner, until the proclamation of the Catalan Republic” as he took his seat in the Senate.
The sight of the separatist leaders, who sparked Spain's worst political crisis in decades with their bid to break Catalonia away, taking their seats in parliament may inflame passions on both sides of a divided country.
- Interview: 'We defeated repression through the power of voting'
- What the election results tell us about the Catalan independence movement
- Elected but behind bars: Jailed Catalan separatist leaders win seats
'Given our voice back'
The five are among 12 Catalan leaders on trial in connection with a banned independence referendum held on October 1, 2017 that was followed by a short-lived declaration of independence.
“They want to silence and marginalise us, and the ballot box has given our voice back,” former Catalan vice-president and the head of Catalan separatist party ERC, Oriol Junqueras, told AFP in a written interview from jail before he was sworn in.
The conservative Popular Party (PP) and centre-right Ciudadanos have said they will try to stop the five men from occupying their posts.
The chambers' governing bodies, which are due to be elected later on Tuesday, will decide whether or not to suspend the five men.
“The suspension is obvious…they can't hold their posts,” acting Deputy Prime Minister Carmen Calvo told news radio Cadena Ser.
While the Socialists emerged as the biggest party in the 350-seat lower house in last month's elections, they lack a majority. To be sworn in as prime minister again Sanchez is likely to rely on some parties abstaining from voting.
But if the jailed Catalan lawmakers are not allowed to take part in Sanchez's investiture vote, and are not replaced, the threshold to be approved will be lower and he could be sworn in without relying on Catalan separatist parties abstaining.
Boosted by its fierce opposition to Catalan separatism, far-right party Vox won 24 seats and entered parliament for the first time in a country that has had no far-right party since the death of dictator Francisco Franco in 1975.
Sanchez, who in June 2018 took over from Mariano Rajoy, a conservative, as prime minister, has bet on dialogue with Catalonia to ease tensions sparked by the separatist push.
Last week he proposed two Catalans to be the speakers of the upper and lower houses of parliament.
Outgoing minister for territorial policy, Meritxell Batet, was on Tuesday elected the speaker of the Congress while philosopher Manuel Cruz was elected speaker of the Senate.
The ERC had blocked Sanchez's first pick for speaker of the Senate, the Socialists' leader in Catalonia, Miquel Iceta.
The party says it is open to dialogue with Madrid but it insists on holding an independence referendum in Catalonia, which Sanchez steadfastly refuses.
A poll published on May 10 by the Catalan government's CEO survey institute showed slight more Catalans are against independence than those in favour — the first time that has happened since June 2017.