JERUSALEM - An Israeli TV drama about two Israeli soldiers freed in a prisoner exchange has drawn angry accusations that it scored ratings by taking advantage of the country's anguish over captive soldier Gilad Schalit.

Now the plot of "Prisoners of War" -- which inspired the new hit American TV drama "Homeland" -- has unfolded into reality.

Schalit returned home Tuesday in a prisoner swap with the Hamas militant group after more than five years in captivity in the Gaza Strip.

Scenes of Schalit's arrival could have easily been mistaken for scenes of the release of the fictional soldiers in last year's opening episode of the TV show, which is due to start its second season soon.

Cheering throngs gathered with flags and banners for Schalit, just as extras did in the TV program. Banners with slogans calling for the release of Schalit looked uncannily similar to banners depicting the show's fictional soldiers. Real-life TV broadcasters presented fictional news bulletins on the show announcing the impending arrival of the POWs -- the same broadcasters who later reported real news about Schalit.

That blurring of fiction and reality provoked many Israelis -- including Schalit's family.

"Gilad is not an imaginary (POW)," his parents said in a statement when the show debuted last year.

"The overuse of symbolic reality was appalling," wrote TV critic Ariana Melamed on the popular Israeli news site YNet. She called the show "an unprecedented manipulation of the public's emotions."

Another critic called the news anchors' cameos "scandalous" because they broke down the barrier between TV drama and serious current events.

"It was hard for me to see those manipulations," said Moran Sharir, TV critic for the Israeli daily Haaretz.

Still, he said the coverage of Tuesday's prisoner swap proved "just how real the show is."

Gideon Raff, the writer and director of "Prisoners of War," refused to draw parallels between his show and Schalit's release. He insists his show was not modeled after the Schalit affair, but was inspired by the experiences of prisoners of war who returned to Israel. He denies that he was capitalizing on Israelis' raw emotions.

"We've tried to make the best drama we could," he said. "We've regarded the subject with respect."

"Prisoners of War" follows the fictional story of three soldiers taken captive in Lebanon during a botched clandestine operation against a senior terror figure. After 17 years, Israel negotiates a prisoner exchange and the soldiers -- two alive, one in a coffin -- are returned to Israel. The soldiers and their families struggle to resume normal lives. Meanwhile, an Israeli official interrogates the returning soldiers, out of suspicion that they may be acting as spies for their former captors.

In a country with a military draft, people are protective and emotional about prisoners of war. Israeli leaders have previously agreed to lopsided prisoner swaps with militant groups, much like the deal to free Schalit, arguing that they must uphold their social contract with the nation not to abandon soldiers on the battlefield.

There are about 400 former prisoners of war living in Israel today. A number of others are still considered missing in action.

For his scripts, Raff interviewed psychologists specializing in POW post-trauma and met with former Israeli prisoners of war. Some of their experiences of returning home made it into plotlines.

Like the fictional soldiers, Israeli POWs from the 1973 Yom Kippur war were taken to an isolated Israeli facility and interrogated about their captivity, an experience they say was demoralizing and traumatic.

A number of former POWs appeared in an episode depicting a support group.

Hezi Shai, who was held in Lebanon for three years in the 1980s following Israel's first Lebanon War, said the show gives a glimpse of "what happens to (POWs) when they are back home and start to live a regular life."

"Not all of them are in good shape or have a good life," Shai said.

Because he was one of the last Israeli POWs to return home alive, Shai acted as a consultant to the TV show -- and to Israel's military.

Shai said about a year after Schalit's capture, a military representative contacted him to ask how the army should handle Schalit's return, whenever it would be.

Schalit, 25, appeared gaunt and frail upon his return and his initial medical examination said he was malnourished and suffered from a lack of exposure to sun and had minor wounds from his initial capture. His father, Noam, has since said he went through a "difficult experience" in captivity. He did not elaborate.

The Israeli show's American spinoff, "Homeland," debuted this month on Showtime, telling the story of an American soldier released from captivity in Iraq. He receives a hero's welcome, but a CIA officer played by Claire Danes suspects him to be an al Qaeda turncoat.

Despite harsh reviews, the Israeli show garnered high ratings. A quarter of Israeli viewers watched the first season of "Prisoners of War," according to Israeli production company Keshet, making it one of the top 10 most-watched shows of the past decade.

Sharir, the Israeli TV critic, didn't like the show's blending of fiction with reality, but tipped his hat to the show for captivating so many Israelis at such a vulnerable, tribal level.

"It talks to the audience's kishkes," he said, using the Yiddish word for gut.