A U.S. federal agent arrested at a Pakistani airport for carrying guns and ammunitions was released on bail, officials said Thursday.

The court ordered the FBI agent to submit a surety bond of one million rupees ($9,800) for his bail..

The agent was detained at the airport in the southern city of Karachi Monday when he had to board a flight to Islamabad. According to police officer Rao Anwar, the federal agent was also carrying electronic devices that are now being examined, reports the Associated Press.

According to the U.S. law enforcement officials, the agent was working in Pakistan as part of an anti-corruption task force. His details are being withheld due to diplomatic sensitivity.

U.S. State Department spokeswoman Jen Psaki confirmed the detention Wednesday, and said the U.S. was holding discussions with Pakistani authorities to solve the matter.

The arrest marks the latest incident between the two troubled allies. The U.S. depends on Pakistan in its fight against al-Qaeda and its attempts to bring peace in  neighboring Afghanistan. However, U.S. drone strikes, which have led to civilian casualties have upset the Pakistanis, Sky News reports.

American forces inadvertently killed 24 Pakistani troops along the Afghan border in 2011, according to the Associated Press.

In April, a New York Police Department officer was detained  in India's capital New Delhi for carrying three bullets. The 49-year-old officer was in the capital city to visit his wife Vida, an Iranian student and was stopped at the airport. He appeared in court the same day and was granted bail.