* U.S., Kabul seeking to shape post-2014 troop presence
* Prisoner issue further straining ties
* Senator warns of "irreparable damage" if inmates freed
By Jessica Donati
KABUL, Jan 2 (Reuters) - U.S. senators visited the Afghan president on Thursday to try to push forward talks to sign a crucial bilateral security deal and halt the release of prisoners the United States considers a threat to security.
Afghanistan plans to release hundreds of prisoners from Bagram prison, which was handed over from U.S. control only after a deal was reached in March after intense negotiations because Washington feared dangerous inmates would be freed.
The disagreement further strains relations between the two countries, which are already at breaking point over President Hamid Karzai's refusal to sign a bilateral security deal to shape the post-2014 U.S. military presence in the country.
Without the pact, Washington could pull most of its troops out after this year, when most foreign troops are due to exit.
The senators told Karzai that releasing dangerous prisoners would irreparably damage ties with the United States, but stopped short of saying it would prompt a full military withdrawal after 2014.
"If these releases go ahead it will do irreparable damage to the relationship," Republican Senator Lindsey Graham told reporters at a news conference in Kabul on Thursday.
Washington considers 88 of some 650 prisoners marked for release a serious threat to security, saying they are responsible for wounding or killing 57 Afghans and 60 U.S. and coalition troops.
It wants them to be investigated and tried. Afghanistan says there is not enough evidence to keep them detained.
Karzai has called the so-called "zero option" over the pact an empty threat and suggested any deal can wait until after the presidential elections in April. The United States says it needs time to prepare a post-2014 mission and set an end of year deadline that has now passed.
The visiting officials gave no indication of how much longer the government might wait to sign the security deal but stopped short of saying releasing the prisoners would drive a final nail in the coffin of talks.
"We're going to have to just wait and see what happens ... we can't go any further in our comments except that it does damage," Senator John McCain, also a Republican, told reporters.
"As a result of our long meeting with president Karzai we have narrowed those diferences and I believe we can look forward to signing the Bilateral Security Agreement ... sooner rather than later."
Karzai's spokesman was not immediately available to comment on whether the president would consider intervening to stop the release.
Billions of dollars in foreign aid will also hinge on a deal being reached to allow U.S. troops to stay beyond 2014.
Afghanistan relies on donors for most of its budget and would have difficulty funding its police and army without international help.
Highlighting the increasingly violent struggle against the Taliban insurgency, a motorcycle bomb exploded in a market in Logar province on Thursday, south of the capital, killing nine people and wounding 18 others, according to local officials. (Additional reporting by Mirwais Harooni and Hamid Shalizi; Editing by Alison Williams)