WASHINGTON — Impatient with years of delays, a federal judge on Friday gave the State Department some tight deadlines to provide The Associated Press with thousands of pages of documents related to Hillary Rodham Clinton – a timetable that means many of the files should be released well before the U.S. presidential primary elections.

Friday’s order came one week after U.S. District Judge Richard Leon chastised the department for its slowness in satisfying years-old records requests, including for Clinton’s schedules and calendars.

The AP sued in March after the department failed to turn over files requested under the Freedom of Information Act, including one request made more than five years ago.

Since then, the State Department has said it struggled to meet the AP’s demand on time because of limited staff resources and thousands of other pending requests. But at a hearing last month, Leon appeared troubled that the document requests had gone unsatisfied.

State Department spokesman Mark Toner said the department was aware of the judge’s order but wouldn’t comment further on a pending lawsuit.

It was not immediately clear whether the State Department will comply with the judge’s order or ask an appeals court to give it more time.

“We are very pleased Judge Leon set a tight production schedule for review and release of these public documents,” AP’s general counsel Karen Kaiser said in a statement. “We remain committed to the goal of getting this important information released to the public as quickly as possible.”

Under the new schedule, the State Department will have 30 days to produce roughly 68 pages of documents related to Clinton’s former top aide, Huma Abedin.

Within 90 days the department must turn over nearly 5,000 pages of calendars and schedules from Clinton’s four years as secretary of state. The State Department will have eight months to produce 13,387 pages of materials concerning its oversight of military contractor BAE Systems during the years Clinton served as secretary of state.