The biggest challenge in Afghanistan is building reliable and capable Afghan security forces, and U.S. commanders still have too few troops to do the job, Defense Secretary Robert Gates says.

Saying that violence will continue in Afghanistan until insurgents'' safe havens in Pakistan are eliminated, Gates said it is crucial for the U.S. to maintain a strong relationship with Islamabad''s fledgling government.

In testimony prepared for delivery Tuesday before the Senate Armed Services Committee, Gates paints a somber picture of the hurdles in Afghanistan, as the U.S. heads toward its eighth year at war there.

He said the U.S. must encourage Afghanistan and Pakistan to work together to secure their border — a volatile region that has seen an increase in deadly clashes in the past year. The violence there has been exacerbated by ongoing tensions over cross-border incursions by U.S. troops as well as reports of civilian casualties, and unconfirmed suggestions that U.S. helicopters have been targeted by Pakistanis during border operations.