U.S. District Judge Harold Baer Jr. handed down the order late Wednesday in New York. The AP lawsuit already has led to the disclosure of previously unreleased flight logs from Bush's days piloting F-102A fighters and other jets.
Pentagon officials told Baer they plan to have their search complete by Monday. Baer ordered the Pentagon to hand over the records to the AP by Sept. 24 and provide a written statement by Sept. 29 detailing the search for more records.
White House officials have said Mr. Bush ordered the Pentagon earlier this year to conduct a thorough search for the president's records, and officials allowed reporters to review everything that was gathered back in February.
Both Mr. Bush's and John Kerry's military service records have become a major issue in the presidential race. New records that have surfaced in recent weeks have raised more questions.
Mr. Bush's critics say the president got preferential treatment as the son of a congressman and U.N. ambassador. Critics also question why Mr. Bush skipped a required medical examination in 1972 and failed to show up for drills during a six-month period that year.
Mr. Bush has repeatedly said he fulfilled all of his Air National Guard obligations.
The controversy over Mr. Bush's military service sharpened last week when CBS News' 60 Minutes disclosed memos said to be written by the late Lt. Col. Jerry Killian, Mr. Bush's National Guard commander.
The memos indicated that Killian had been pressured to sugarcoat Mr. Bush's performance, and that the future president had ignored an order to take a physical.
The authenticity of the memos have been challenged by critics who say the documents appear to have been prepared on a modern computer rather than a 1970-era typewriter, as would have been the case when Mr. Bush was in the guard.
Skeptics have also said the memos contain stylistic differences with other documents attributed to Killian, dated information and improper military lingo. Meanwhile, associates of the Col. Killian are split on whether the content of the memos reflected his thinking at the time.
CBS flew Killian's former secretary,, 86, from Texas to New York for an interview. In the interview, Knox said she believed the documents were fake, but their content accurately reflected Killian's opinions.
"I know that I didn't type them," she said. "However, the information in those is correct."
Acknowledging questions raised about the documents suggesting lapses in Mr. Bush's National Guard service, CBS News promised a concerted effort to determine their authenticity while standing by its story.
"Enough questions have been raised that we are going redouble our efforts to answer those questions," CBS News President Andrew Heyward said.