BENGHAZI, Libya (CNN) -

The remains of U.S. Ambassador to Libya J. Christopher Stevens and three other Americans landed on U.S. soil Friday afternoon in flag-draped caskets.

The four men were killed in an attack this week on the U.S. Consulate in Benghazi.

Teams of seven Marines carried the caskets off a C-17 plane at Joint Base Andrews in Maryland in a ceremony attended by a color guard and a chaplain, Army Col. Wesley Smith.

President Barack Obama and Secretary Hillary Clinton gave remarks at the solemn transfer of remains in an airport hangar, where four hearses with rear doors open waited for the caskets. Families of the victims and dignitaries were seated facing the hearses and a lectern.

"There's no doubt these are difficult days," said Obama. But he pledged that "the United States of America will never retreat from the world."

"Four Americans, four patriots, they loved their country and chose to serve it and serve it well," the president continued. "They had a mission and they believed in it, and they knew the danger and they accepted it. They didn't simply embrace the American ideal, they lived it, they embodied it: the courage, the hope and, yes, the idealism.

"We will bring to justice those who took them from us," Obama said.

Clinton said that Libya, Egypt and Tunisia "did not trade the tyranny of a dictator for the tyranny of a mob." Those countries' leaders "need to do everything they can to restore security" in the face of anti-American protests arising from an "awful Internet video," she said.

Clinton said the four victims' lives -- as well as all people who work in the Foreign Service -- "are at the heart of what makes America great and good."

"America must keep leading the world. We owe it to the these four men to continue the long, hard work of diplomacy," Clinton said. "We will wipe our tears and stiffen our spines and face the future undaunted."

Defense Secretary Leon Panetta and Vice President Joe Biden also attended the ceremony.

The other men killed in Libya include Tyrone Woods and Glen Doherty, both former Navy SEAL commandos working as diplomatic security officers. The fourth was Sean Smith, an information management officer who also had an online alter-ego legendary in the gaming world.

Four people have been arrested in connection with the attack that left Stevens and the three other Americans dead, the top aide to the president of the Libyan parliament said Friday.

Those arrested were not directly tied to the attack, Monem Elyasser, the chief aide to Prime Minister Mustafa Abushagur, told CNN by telephone.

Elyasser did not release the identities of the four suspects in custody, nor did he detail the allegations against them.

The announcement came as the United States is struggling to determine whether a militant group planned the attack that killed the four Americans.

The head of Libya's ruling General National Congress, Mohammed Al-Megaryef, also confirmed the four arrests but declined to say to what group the suspects are linked.

However, the government now believes the suspects are part of one of the many armed extremist groups operating especially in the eastern part of the country and Benghazi itself, he told CNN.

Authorities also believe the attack was planned and deliberately carried out to inflict maximum damage on key Western interests, particularly the United States, he said.

The government believes the attack was intended to drive a wedge between Americans and Libyans.