The Justice Department seized records of 20 separate phone lines used by reporters or editors for the Associated Press, in a move that officials familiar with the case said was intended to gather information for a leak investigation involving a May 2012 AP story about a counterterrorism operation in Yemen.

The Justice Department notified AP on Friday that records had been subpoenaed from telephone companies several months ago. The subpoenas covered a two-month period around the time AP wrote the story about an alleged conspiracy...