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 arrived at the two assemblies from a jail near Madrid for the swearing in ceremony in police vehicles to applause from supporters.
"They want to silence and marginalise us, and the ballot box has given our voice back," Junqueras, a former Catalan vice president and the head of leftist Catalan pro-independence party ERC, told AFP in a written interview from jail.
He is the main protagonist in the trial that opened in February at Spain's Supreme Court in Madrid of 12 Catalan leaders accused of rebellion and other charges in connection with a banned independence referendum held on October 1, 2017 that was followed by a short-lived declaration of independence.
Junqueras is also standing in European Parliament elections on Sunday.
Since 2017, Catalan pro-independence parties have presented jailed or exiled leaders, such as former regional president Carles Puigdemont, as election candidates to draw attention to their plight and create pressure for their release.
The conservative Popular Party (PP) and center-right Ciudadanos have said they will try to stop the five men from occupying their posts.
The presidency councils of both the lower and upper house of parliament will now have to decide whether to suspend the five jailed Catalan leaders.
"We can't deny that the situation and the scenario are exceptional but in any case judicial decisions will be respected," said Meritxell Batet, outgoing minister for territorial policy who is the Socialists' candidate for speaker of the lower house of parliament.
Acting Prime Minister Pedro Sanchez's Socialists won the most seats in the April 28 general election but lack a majority in the 350-seat lower house of parliament.
Boosted by its fierce opposition to Catalan independence, far-right party Vox won 24 seats and will enter parliament for the first time.
To be sworn in again as prime minister, Sanchez is likely to rely on some parties abstaining from voting. If the jailed Catalan MPs are not allowed to take part in Sanchez's investiture vote, the threshold to be approved will be lower and he could be sworn in without relying on Catalan pro-independence parties abstaining.
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.
Conservative parties repeatedly attack his overtures to the pro-independence parties who still rule Catalonia and instead call for the wealthy northeastern region's autonomy to be suspended.
Catalan pro-independence leaders, who consider Junqueras and the other 11 leaders on trial in Madrid as "political prisoners," are sending Sanchez mixed messages.
The ERC has said it is open to dialogue but it insists on holding an independence referendum in Catalonia, which Sanchez steadfastly refuses.
Catalan pro-independence parties last week blocked the nomination of the Socialists' leader in Catalonia, Miquela Aceta, to be the speaker of the Senate.
Sanchez then nominated another Catalan to be speaker of the Senate, philosopher Manuel Cruz, as well as a Catalan to be speaker of the lower house, Bate.