Image caption Seldom has security been so tight in the Afghan capital

Afghan President Hamid Karzai has told a meeting of tribal elders that a security pact with the US is in the best interests of both nations.

He was addressing the gathering, or loya jirga, in the capital, Kabul, amid tight security.

The president said that any deal with the US could only work if Afghan sovereignty was respected.

The Taliban have threatened to attack the meeting. They have warned that anyone who attends will be a target.

On Monday the Taliban said that they had obtained a confidential government security plan for the jirga.

On the same day a suicide bomber was shot dead in an attempted attack on the tented site in Kabul where 2,000 people were to meet.

Taliban strongholds

President Karzai told the assembly on Wednesday morning that Afghans wanted their relationship with the US to be one between two independent countries.

"We want to have a strong partnership with the US and Nato, but with conditions," he said.

He added that he wanted an end to night raids - the tactic in which Nato soldiers raid civilian houses suspected of harbouring insurgents - and detention of his countrymen.

"We don't want parallel structures alongside our government," the president said.

Mr Karzai will discuss reconciliation efforts with the Taliban after 10 years of war in addition to relations between Afghanistan and the US.

He said that there was a possibility some US troops could remain in Afghanistan before a scheduled full withdrawal in 2014.

"If they want military bases we will allow them. It will benefit us and our forces will be trained," he said.

Mr Karzai also said that he would shortly announce a second tranche of areas to be handed from Nato to Afghan control.

The BBC's Orla Guerin in Kabul says that former Taliban strongholds in southern Afghanistan are expected to be among them.

Afghan officials have said previously that up to 17 areas could be on the list.

'Pointless gathering'

The intense security at the talks is a reminder of the constant danger posed by the insurgents even in the capital, correspondents say.

Image caption The Taliban on Monday published what it said was the government's security plans for the meeting

The BBC's Bilal Sarwary in Kabul says roads leading to the jirga area are blocked to the public and that there are far more checkpoints than usual.

Houses close to the gathering have been searched and thousands of police and plain-clothed security personnel have been deployed alongside mobile police patrols and intelligence service vehicles, says our correspondent.

Extra forces have also been deployed on the outskirts of Kabul - people are unable to enter the city without showing their identity cards.

Diplomats in Kabul say Mr Karzai will try over the course of the four-day meeting to secure a strong mandate from delegates as he pursues a controversial agreement with the United States on the strategic partnership which will determine the Afghan-US relationship after 2014.

But critics say without an agreement to discuss, the gathering is pointless.

Officials say the decisions made at this jirga will not be legally binding. Parliament will have the final say.

There are about 100,000 US troops in Afghanistan who operate without any bilateral agreement governing their actions.

But the council could give the president scope for negotiations over a deal to keep some in Afghanistan for another decade despite opposition from his people and the war-weary American public.

In Washington, State Department spokesman Mark Toner said discussions were ongoing with the Afghan government.

"We want an agreement that's in the best interest of both our countries," Mr Toner said. "It's better to get it right rather than fast."