* Hagel on first trip to Afghanistan as defense chief
* Karzai says Taliban bombs "in service of America"
* U.S. denies Karzai's allegations of Taliban peace talks (Recasts with Hagel reaction)
By Mirwais Harooni and Phil Stewart
KABUL, March 10 (Reuters) - Afghan President Hamid Karzai ratcheted up his criticism of the United States on Sunday, marring a debut visit by the new U.S. defense secretary, Chuck Hagel, and highlighting tensions that could undermine Washington's strategy to wind down the unpopular war.
A day after two Taliban bombings killed 17 people, Karzai accused the United States and the Taliban of colluding to convince Afghans that foreign forces were needed beyond 2014, when NATO is set to wrap up its combat mission and most troops withdraw.
"Those bombs that went off in Kabul and Khost were not a show of force to America. They were in service of America. It was in the service of the 2014 slogan to warn us if they (Americans) are not here then Taliban will come," Karzai said in a speech.
"In fact those bombs, set off yesterday in the name of the Taliban, were in the service of Americans to keep foreigners longer in Afghanistan."
It was one of several inflammatory comments by Karzai and his government on Sunday and follow weeks of efforts by the Afghan leader to curtail U.S. military activity in Afghanistan, including a call to kick American special forces out of an important province. U.S. commanders see special operations forces as key to the end-phase of the conflict.
Hours after Karzai's speech, Hagel said he spoke "clearly and directly" about the comments during his first meeting with the Afghan leader since becoming U.S. defense secretary on Feb. 27.
Hagel appeared at pains to be respectful of Karzai and avoid sharp criticism, but he told reporters that any collusion between the U.S. and the Taliban "wouldn't make a lot of sense."
The U.S. and NATO commander in Afghanistan, General Joseph Dunford, was more categorical.
"We have fought too hard over the past 12 years, we have shed too much blood over the past 12 years, we have done too much to help the Afghan security forces grow over the last 12 years to ever think that violence or instability would be to our advantage," Dunford told reporters travelling with Hagel.
Of Karzai's remarks, he added: "I'll let others judge whether that's particularly helpful or not at the political level."
Still, politics will be key over the next several months, as the United States and NATO allies work to carry out their strategy of pulling out their troops and decide how large a residual force to leave behind after 2014.
NATO defense chiefs meeting in Brussels last month discussed keeping a combined U.S. and allied force of 8,000-12,000 in Afghanistan, focusing on training Afghan troops and countering the remnants of al Qaeda, the Pentagon has said.
Any deal for a follow-on force, which Washington says must include immunity for U.S. troops, would need Karzai's blessing.
ABUSING STUDENTS? TALIBAN TALKS?
Karzai has a history of making incendiary statements that exasperate Washington but the nature and awkward timing of his latest remarks about the United States were exceptional.
He also alleged on Sunday that the Taliban and the United States had been holding talks in the Gulf Arab state of Qatar on a "daily basis," further fuelling his suggestion that Washington and the militants were working at common purposes.
"I told the president that it was not true," Hagel said. "The fact is any prospect for peace or political settlements - that has to be led by the Afghans."
The Taliban spokesman in Afghanistan, Zabihullah Mujahid, denied that negotiations with the United States had resumed.
Karzai's government also alleged that U.S.-led forces and Afghans working with them were abusing and arresting university students. Karzai issued an executive order banning foreign troops from entering all education institutions.
Hagel and Karzai were meant to have appeared together at a joint news conference on Sunday evening. But, in a reminder of the threats posed by the resilient insurgency, U.S. officials said it was cancelled because of security concerns.
Hagel was about a kilometre away and within earshot of a Saturday morning suicide attack outside the defense ministry that killed nine people. He was meant to have met his Afghan counterpart there this weekend but the venue was later changed.
Hagel's visit coincided with the passing of a deadline imposed by Karzai for U.S. special forces to leave Wardak province accusing them of overseeing torture and killings.
U.S. forces have denied involvement in any abuses.
Hagel has sounded hopeful that a deal could be reached on their continued deployment but acknowledged no breakthroughs were made in his talks with Karzai.
It was unclear how Hagel's trip would be viewed by U.S. Republicans who bitterly fought his nomination to become defense chief, portraying him as soft on Iran and questioning his judgement.
Hagel at times appeared sympathetic to the stresses of political life that Karzai must endure.
"I know these are difficult issues for President Karzai and the Afghan people. And I was once a politician," Hagel said. "So I can understand the kind of pressures - especially leaders of countries - are always under." (Additional reporting by Hamid Shalizi; Writing by Phil Stewart, Michael Georgy and Jeremy Laurence; Editing by Christopher Wilson and Peter Graff)