"The message that we are sending around the world is that the United States intends to prosecute the ongoing struggle against violence and terrorism," Obama said.
"We are going to do so vigilantly; we are going to do so effectively; and we are going to do so in a manner that is consistent with our values and our ideals."
Obama had promised to close the detention centre during his election campaign.
Guantanamo was set up by the Bush administration in 2002 to hold prisoners it detained as part of its so-called war on terror.
|Guantanamo prisoners will be treated in a
manner consistent with international law [AFP]
More than 240 prisoners remain held there, including Khalid Sheikh Mohammed, who is suspected of planning the September 11 attacks on the US.
The White House said the order closing Guantanamo also sets up a series of reviews to determine whether it is possible to transfer prisoners to their home countries, if US national security is not threatened.
If that is not possible, the review will then look at options for prosecuting them, the White House said in a statement.
The order also orders that all prisoners held at Guantanamo be held in a manner consistent with the Geneva Conventions until the facility is closed.
Al Jazeera's Anand Naidoo in Washington DC said it was likely that the five men facing charges over the September 11 attacks would face some kind of prosecution on US soil.
The US president also said he was setting up a task force that would have 30 days to recommend policies on handling "terror" suspects who are detained in future.
The force would look at where those detainees should be held instead of Guantanamo.
On Thursday, Obama had ordered a halt to military tribunals of al-Qaeda suspects held at the camp, including those suspected of involvement in the September 11 attacks.
Shane Kadidal, a senior lawyer at the Guantanamo Global Justice Initiative that works on behalf of detainees, told Al Jazeera the move was a step in the right direction.
"We've always said that these military commissions were insupportable. The system was designed to launder evidence gained through torture and all those cases should be transferred to ordinary federal courts."
The order ending harsh interrogations also requires that all interrogations follow the US Army's Field Manual interrogation guidelines, which ban the use of techniques such as "waterboarding," which simulates the sensation of drowning.
The order bans the CIA from operating secret prisons, and forbids them from opening any new such facilities.
It also ends US government reliance on a series of controversial legal advice notes on the treatment of prisoners drawn up by Bush administration advisers.
The order, however, does not ban the controversial practice of rendition, which involves the secret detention and transfer of "terror" suspects from one country to another.
It does, however, order a review of the practice.
Obama also issued a memorandum ordering a review of the case of Ali Saleh Kahlah al-Marri, a Qatari citizen and the only "enemy combatant" held on US soil at a Navy prison in South Carolina.