In his last speech before leaving the U.S., Pope Benedict XVI said he "deeply appreciated" the country's warm response to his first papal visit.

"God bless America," the Pope said Sunday evening at his departure ceremony at John F. Kennedy International Airport. "These days I've spent in the United States have blessed me with many memories of American hospitality."

Vice-President Dick Cheney was among those at the ceremony.

It was a busy last day for the pontiff. He delivered the homily at a mass at Yankee Stadium before almost 60,000 people Sunday afternoon, speaking about freedom and telling Catholics not to "lose faith in adversity and scandal."

Benedict concentrated greatly on the topic of freedom in the 20-minute homily saying that handing over authority to God is not easy "especially in a society that rightly places value on personal freedom."

"Real freedom is God's gracious gift," he added.

He also spoke of unity for the 65 million Catholics in America, as there are tensions in the church, often splintered on political party lines.

The mass in New York's hallowed ballpark had a quite different atmosphere than the average Sunday morning service. The audience broke out in applause at the mention of Pope John Paul II's name.

Earlier on Sunday, the Pope lit a candle, said a prayer and sprinkled holy water during a sombre prayer service at the site of the 2001 World Trade Center.

About two dozen people -- including survivors of the attacks, four rescue workers, and some relatives of victims who died -- joined Benedict for the service near what has become known as "Ground Zero."

He described the scene on Sept. 11, 2001, when al Qaeda extremists flew two hijacked airliners into the massive structures, as one of "incredible violence and pain."

More than 2,700 people died, most after the massive skyscrapers collapsed. Many of those who died leaped to their deaths rather than be consumed in the inferno caused by the burning jets. The remains of more than 1,100 victims were never identified.

"We ask, in Your greatness, to give eternal life and peace to all those who died here," Benedict said.

He mentioned "the heroic first responders: our firefighters, police officers, emergency service workers, and Port Authority personnel" as well as workers and visitors to the building that that morning. The WTC towers were seen as a symbol of American economic might.

The Pope also offered this thought: "God of peace, bring your peace to our violent world: peace in the hearts of all men and women and peace among the nations of the Earth. Turn to your way of love those whose hearts and minds are consumed with hatred."

Prominent regional political and religious officials were also at the service.

James Riches, New York's deputy fire chief, had a firefighter son die on Sept. 11. He said Benedict's visit gave him "a little consolation."

The Pope also prayed for the victims of the attacks on the Pentagon and United Airlines Flight 93. The flight went down in Shanksville, Pa., before reaching Washington, D.C., the hijackers' reported target.

Although the ceremony was relatively small, hundreds of people jammed behind police barricades, hoping to get a glimpse of the Pope.

In addition to addressing the sexual abuse scandals which have plagued the Roman Catholic Church over the decades, the Pope has used his six-day visit to the U.S. to speak about international terrorism.

A joint statement by the American government and the Catholic Church said that during a private meeting in Washington earlier, the Pope and President Bush "touched on the need to confront terrorism with appropriate means that respect the human person and his or her rights."

Terrorism was also one of the prominent issues the Pope addressed during an address to the United Nations on Friday. He told the world's diplomats that they needed to come together and co-operate to resolve pressing international problems.

Benedict also said security concerns should be balanced with respect for human dignity.

"The promotion of human rights remains the most effective strategy for eliminating inequalities between countries and social groups, and increasing security," the Pope said.

Benedict is expected to head back to Rome following his New York visit.

With files from The Associated Press