Spanish minister of foreign affairs and cooperation José Manuel García-Margallo said at a press conference that two Spaniards who had been reported missing "have been found alive and well".
The minister identified those found as Juan Carlos Sánchez and Cristina Rubio.
A museum employee hid the two Spaniards in an office during the four-hour rampage by gunmen in military uniform.
All three were taken to hospital on Thursday for medical checks after their ordeal, a civil protection official told AFP outside the National Bardo Museum.
The mother of the museum employee Lassaad Bouali said she had feared her son had been killed.
"I thought my son was dead. It's such a relief," she told AFP, declining to give her name.
There was no immediate explanation from the authorities as to why they had failed to find the trio when police secured the building after the attack.
Isis on Thursday claimed responsibility for the attack which left 17 foreign tourists dead, including at least two Spaniards, with the extremist group hailing the deadly shooting as a "blessed invasion".
A couple from Barcelona were among the tourists killed, Spanish media reported.
According to El Pais, the Catalan couple were Cirera Antonio Perez, 75, and Rami Dolores Sánchez, 73.
García-Margallo said that the government is arranging to have the couple's bodies flown back to Spain.
A Colombian mother and child on a family holiday were also among the tourists killed in the gun attack in Tunisia, the Columbian government said as conflicting breakdowns of the casualties emerged from different national authorities.
The father of the Colombian family survived, the foreign ministry in Bogota said on Wednesday, giving no further details.
Victims of the assault on the National Bardo Museum in the country's capital Tunis also included tourists from France, Spain, Japan, Australia, Italy and Poland, as well as two Tunisians.
The tolls given by individual countries differed at times from a detailed breakdown by Tunisia's Prime Minister Habib Essid.
He said that among the dead were five Japanese, four Italians, two Colombians and one each from Australia, Poland, France and Spain.
The nationality of a 16th victim was not given, while the identity of the final fatality had not yet been established.
Spanish Foreign Minister Jose Manuel Garcia-Margallo said two Spanish citizens had lost their lives in the attack, but did not say whether any Spaniards were injured.
He said the victims were part of a group of tourists who had disembarked from two cruise ships to visit Tunis. One of the ships had 60 Spanish nationals on board, the other 30.
"I can't rule out that there will be more dead or injured," the minister said at a press conference.
French President Francois Hollande said two French tourists had been killed, and at least seven were wounded, with one in serious condition.
Japanese Prime Minister Shinzo Abe said three Japanese nationals had been killed and three injured in what his government condemned as a "despicable act of terrorism".
The Italian foreign ministry gave a toll of three dead and six injured, and said the families of the victims had been notified.
In Poland, the speaker of the lower house, Radoslaw Sikorski, said "very likely seven Polish people were killed". The country's foreign ministry only confirmed 11 injured.
Colombia's President Juan Manuel Santos had earlier confirmed the two Colombian deaths.
The British foreign ministry said two of its citizens were "caught up" in the attacks, but did not clarify whether they had been hurt.
Earlier, French Foreign Minister Laurent Fabius, speaking at a press conference in Paris alongside his Tunisian counterpart, had said six Frenchmen had been hurt in the attack, three of whom were "in a serious condition".
A Tunisian bus driver and a Tunisian policeman also lost their lives when gunmen stormed the museum.
Security forces killed two attackers and were hunting for possible accomplices, the Tunisian premier said.