Ilan Grapel, an American-Israeli citizen jailed in Cairo on suspicion of espionage for over four months, met with Prime Minister Benjamin Netanyahu in Israel on Thursday after he was released. Grapel told the prime minister that he underwent difficult times in prison, but was treated fairly.

Grapel was freed in exchange for 25 Egyptian prisoners, all held on criminal charges, who were released to Egypt prior to his return.

Grapel landed at Ben-Gurion Airport Thursday evening accompanied by Kadima MK Yisrael Hasson and attorney Yitzhak Molcho who mediated the talks leading up to his release.

Grapel was met by his mother, Congressman Gary Ackerman whom Grapel worked for and American Ambassador to Israel Dan Shapiro.

The American-Israeli went with his mother straight from the airport to a short meeting with Prime Minister Benjamin Netanyahu at his office in Jerusalem. Grapel thanked the prime minister for his efforts to secure his release, and told him about his time in prison.

“This was hanging on a thread and I am glad it worked,” Netanyahu said. “I am very grateful to the governments of Egypt and the United States.”

MK Hasson told Haaretz on Thursday that Grapel had explained that he had come to Cairo as part of his studies and because he was interested in the goings-on in Egypt.

“He said that he went to demonstrations out of curiosity, and never imagined that he would find himself in prison,” Hasson said.

According to Hasson, during the talks to secure Grapel’s release, the topic of Oda Tarabin, an Israeli that has been held in Egypt for 11 years, was brought up.

“The issue of Tarabin was on the table, and is still on the table and I hope it will end for the best. The less we speak about it, the better,” Hasson said.

State Department Spokesperson Victoria Nuland said in a statement that “the United States welcomes the release of Ilan Grapel, who we have worked hard to bring home since his June detention in Egypt.”

She thanked the governments of Egypt and Israel for their roles in reuniting him with his family, adding, “the Egyptian-Israeli Peace Treaty is a vital element of regional peace and stability, and we strongly support both countries’ sustained commitment to its provisions.”