The Costa Fascinosa docked at the port in Palma on the Mediterranean island of Mallorca while the MSC Splendida arrived at Barcelona's port in northeastern Spain.
Seventeen of the 20 foreigners killed in Wednesday's attack at Tunis' National Bardo Museum had been passengers on the ships. The dead included Japanese, French, Italian, British, Polish, Spanish, Australian, Polish and Belgian citizens.
In Palma, Spanish cruise ship passenger Catalina Llinas told reporters she and her husband were lucky they chose a day trip to the Roman ruins of Carthage instead of the museum excursion. The couple's tour bus, she said, passed by the museum about 10 minutes before the attacks.
Belgian tourist Karin Dons said she was not at the museum at the time of the attack but heard the shootings. She didn't realize what had happened until she returned to the ship and saw the reports on television.
More From This Section
"Then you realize (what) you escaped from but other people are not lucky," she said on leaving the ship in Barcelona. Dons said the atmosphere on the ship that night was gloomy.
"Many people were sad, many people (were) not at the table in the evening for dinner," she said.
A total of 23 people died in the shootings, including one police officer and the two gunmen.
Also due to arrive in Spain are Juan Carlos Sanchez and Cristina Rubio, a Spanish couple that witnessed the attack but survived by hiding all night in the building. Rubio is four months pregnant.