WASHINGTON – Federal prosecutors secretly obtained records of telephone calls from more than 20 telephone lines belonging to The Associated Press and its journalists over a two-month period in an apparent investigation of a leak of sensitive information about a terrorist plot in Yemen.

The head of The Associated Press lodged a formal complaint Monday with the Department of Justice, for what he called an “overbroad collection” of telephone records of the wire service’s reporters and editors.

The unusual monitoring of journalists’ communications appeared to be part of a widening government investigation into information released about a foreign terror attack plot last year.

The investigation appears to be connected to a May 2012 story by the AP that disclosed details of a CIA operation in Yemen to halt an airliner bomb plot that was designed to coincide with the May 2011 killing of al-Qaida leader Osama bin Laden.

Gary B. Pruitt, president and CEO for the AP, said in a letter to Attorney General Eric H. Holder Jr. that federal prosecutors under the direction of Washington prosecutor Ronald C. Machen Jr. obtained records covering a two-month period in early 2012 that not only included the wire service’s headquarters but also bureaus in New York, Hartford, Conn., Washington and the House of Representatives. It also included cellphones and home phones of the wire service’s journalists. Machen’s office declined to discuss specifics of the matter.