Tawfik Okasha (R), looks onvote to choose the head of the Egypt's Parliament late in Sunday's procedural and opening session at the main headquarters of Parliament in Cairo, Egypt, January 10, 2016. REUTERS/Stringer

CAIRO (Reuters) - Egypt’s parliament voted on Wednesday to expel an independent lawmaker who invited the Israeli ambassador in Cairo for dinner, drawing widespread criticism and prompting a fellow deputy to attack him with his shoe.

Speaker Ali Abdelaal announced that 465 lawmakers, out of 490 who attended the session voted to expel Tawfik Okasha from the legislature, less than two months after it was sworn in.

Egypt was the first of a handful of Arab countries to recognize Israel with a U.S.-sponsored peace accord in 1979, but Egyptian attitudes to their neighbor remain icy.

Israel has an ambassador stationed in Cairo but many Egyptian officials make a point of keeping their distance and the embassy has been the focal point of protests in the past.

Okasha, a television presenter and lawmaker known for courting controversy, hosted the Israeli ambassador Haim Koren for dinner at his home in the northeastern Dakhalia province last week. He made the invitation live on his television show.

The move triggered outrage in the media and in Egypt’s parliament, with several lawmakers demanding on Sunday that Okasha be dismissed and one colleague, Kamal Ahmed, hurling his shoe during the session in a fit of anger.

On Wednesday, lawmakers voted to remove him permanently. Witnesses said Okasha tried to get into the session to apologize to colleagues before it was too late but was barred by security on the orders of the speaker.

He sat outside, watching the vote on a screen, and left shortly before the session closed, declining to comment.

In comments earlier this week, Okasha said he had done nothing wrong as Egypt has diplomatic ties with Israel.