The deal, which is still being challenged in an Egyptian court, sparked rare protests last year, with the opposition accusing the government of selling Egyptian territory to its Saudi benefactors.
The vote came after days of heated debate in parliament with opponents even interrupting one committee session with chanting.
Courts had struck down the agreement, signed in April 2016, but a year later another court upheld it.
Lawyers are now challenging the deal before the constitutional court, and President Abdel Fattah al-Sisi will have to ratify it.
More From This Section
The government has said the islands were Saudi to begin with, but were leased to Egypt in the 1950s.
Opponents of the agreement insist that Tiran and Sanafir are Egyptian.
Last evening, dozens of journalists protested against the agreement in central Cairo, before being dispersed by police, journalists' union official Gamal Abdel Rehim told AFP.
Several were briefly arrested before being released but "three reporters are still detained, and contacts are being made with the interior ministry to get them released".
Opponents of the government, and even some of its supporters, were enraged by the secrecy that surrounded the agreement until it was announced.
Generations of Egyptians had grown up learning in school that the two islands belonged to their country, and that soldiers had died defending them during wars with Israel.
Lying at the mouth of the Gulf of Aqaba, the islands can be used to control access to the Israeli port of Eilat. They were captured by Israel in the 1967 Middle East war before being returned to Egypt under the 1979 Camp David Accords.
Over the past weeks, Egypt has blocked dozens of news websites.
While many of the sites are based in regional rival Qatar, others are Egyptian and have expressed criticism of the islands' transfer.