The Associated Press and two other news organizations sued the FBI on Friday to learn who the government paid and how much it spent to hack into an iPhone in its investigation into last year's San Bernardino, California, massacre.

The lawsuit seeks records about the FBI's contract with an unidentified vendor who provided a tool to unlock the phone belonging to Syed Rizwan Farook, who with his wife killed 14 people at a holiday gathering of county workers in December 2015.

Gannett Co., which owns USA Today, and Vice Media LLC joined the complaint with the AP, seeking to learn more about the mysterious transaction that cut short a legal dispute in which the government sought to force Apple Inc. to unlock the phone.

"Understanding the amount that the FBI deemed appropriate to spend on the tool, as well as the identity and reputation of the vendor it did business with, is essential for the public to provide effective oversight of government functions and help guard against potential improprieties,'' said the suit, filed in U.S. District Court for the District of Columbia under the U.S. Freedom of Information Act.

In rejecting earlier requests to divulge the information, the government said revealing the records could affect "enforcement proceedings,'' but did not elaborate.

The case stems from the FBI's announcement in March that it had purchased a tool to unlock the iPhone, aborting the court fight with Apple that had in turn triggered a debate about the proper balance between electronic privacy and national security.

The FBI for weeks had maintained that only Apple could help it unlock the phone. At the Justice Department's request, a magistrate judge in February directed Apple to create software that would bypass security features on the phone so that the FBI could get into the device and scour it for potential evidence. Apple contested the order, saying the FBI's demand set a dangerous precedent and could undercut security protections for its customers.

The two sides were headed for a court showdown when Justice Department officials revealed that a party outside the U.S. government brought it a potential solution to unlock the phone. The FBI said a week later it successfully unlocked the phone using the tool. The suit cites media reports as saying investigators did not find any links to foreign extremist groups.

The FBI would not say how much the solution cost or reveal how it worked. It also refused to share the information with Apple, which had expressed concern that circumventing its security protections could compromise its products.

The suit by the media organizations argues that there was no legal basis to withhold the information and challenges the adequacy of the FBI's search for relevant records. It also said the public has a right to know whether the vendor has adequate security measures, is a proper recipient of government funds and will act only in the public interest.

It was the third suit the AP has filed against the Obama administration under the Freedom of Information Act.