The government has accused a High Court judge of "misunderstandings and errors" over his ruling that a key anti-terror law contravenes human rights.
The government argues public safety comes before rights
Mr Justice Sullivan ruled in April and again last week that control orders which impose detention without charge break European human rights laws.
Home Secretary John Reid is asking the Court of Appeal to overturn the ruling.
The appeal centres on one man who was put under house arrest but not taken to court because of insufficient evidence.
In April, the High Court ruled that evidence behind the home secretary's decision to place the man, known as "MB", under a control order was so weak that it was a breach of his right to a fair trial.
The government had alleged he wanted to go to Iraq to fight coalition forces.
December 2004: Law lords say holding terror suspects without trial is unlawful
April 2006: High Court overturns first control order made, saying the suspect had not received a "fair hearing"
June 2006: Six control orders are quashed by the High Court for breaking European human rights laws
In his ruling last week, Mr Justice Sullivan said control orders were incompatible with the European Convention on Human Rights, which outlaws indefinite detention without trial.
The home secretary had no power to make the orders against six men and they must therefore all be quashed, he said.
But on Monday, Ian Burnett QC, for the home secretary, told the Court of Appeal Mr Justice Sullivan had "misapplied" the requirements of the convention.
"Parliament has crafted a very careful and elaborate statutory regime, which passes muster for all purposes under the convention," he said.
Mr Burnett accused Mr Justice Sullivan of making the "surprising" suggestion that Parliament was "not competent" to legislate and give the government powers to make control orders in the way that it had.
The judge had interpreted the 2005 Prevention of Terrorism Act, which conferred powers to make the orders, "in an artificially restrictive way" and failed to pay proper regard to the nature of the task entrusted to the home secretary by Parliament, Mr Burnett told the Court of Appeal.
The government, not the courts, should decide whether control orders were necessary, he added
"The taking of measures to combat terrorism involves a heavy political responsibility, and it is critical that there be proper political accountability if errors are made.
"Taking steps to protect against risks to national security, of which protecting against terrorism is the most obvious component, is one of the first responsibilities of government.
"Taking precautionary measures on the basis of valuation of risk is part of that task."
"A central part of the government's response to the threat of terrorism", control orders were made only when "necessary and proportionate" with proper safeguards in place, Mr Burnett told the Court of Appeal.
Control orders mean terror suspects can be tagged, confined to their homes and banned from communicating with others.
The orders are imposed on people suspected of terrorism but where there is not enough evidence to go to court.
Under the control orders restrictions, the suspects have to stay indoors for 18 hours a day, between 4pm and 10am, and are not allowed to use mobile phones or the internet.