The District’s top attorney said Monday that he has allowed federal investigators to review city government documents concerning a multimillion-dollar settlement with the alleged financier of a “shadow campaign” for Mayor Vincent C. Gray.

The deal announced Monday by D.C. Attorney General Irvin B. Nathan is the first thaw in a months-long dispute with U.S. Attorney Ronald C. Machen Jr. over whether investigators probing Gray’s 2010 campaign would have access to the records.

Nathan said he has agreed to hand over “any documents sent to or from” Gray (D), as well as others, his office said in a statement.

The documents pertain to the city’s decision to settle a contract dispute with D.C. Chartered Health Plan, a major city contractor owned by businessman Jeffrey E. Thompson.

Four associates of Thompson’s have pleaded guilty to federal charges related to the secret Gray campaign or other campaign finance schemes. Thompson has not been charged or named in court documents, but several people close to the investigation say prosecutors are continuing to build a case against him.

Chartered had sought nearly $15 million in a challenge to the rates it had been paid for managing health care for low-income D.C. residents. The matter was in litigation when the case was settled in September 2011 — about a year, prosecutors allege, after Thompson finished funding the secret campaign on Gray’s behalf.

In a Nov. 25 letter to Nathan, released last month in response to a public records request, Machen said his investigators had discovered “connections and communications” between government officials and Chartered representatives. Machen said in the letter that the documents “may provide evidence of crimes.”

Nathan has defended the Chartered settlement as a good deal for the city.

William Miller, a spokesman for Machen, said in a statement that the agreement over the records does not guarantee that the U.S. attorney’s office will receive “all of the relevant documents currently being withheld by” the D.C. government.

“This agreement only provides a pathway to obtaining the information necessary to this inquiry,” he said. “Until we actually receive the documents we are seeking, our efforts to obtain answers to these serious questions will continue to be impaired.”

The city has turned over about 300 of the roughly 5,000 documents federal investigators are seeking, Miller said.

Machen’s office took the unusual step of providing Nathan and his top advisers with a limited look at some of the confidential information developed in the criminal investigation to establish “our need for some of the documents currently being withheld,” Miller said.

“Our hope is that now that we have demonstrated the importance of our requests, the District of Columbia will promptly provide the documents so that the investigation can move forward without a lengthy court battle,” Miller said.

The agreement announced Monday represents only a first step in removing one of the “obstacles” Machen cited last year to closing out the long-running probe of Gray’s 2010 campaign.

Until Monday, Nathan had declined to release the records, saying they were subject to attorney-client privilege and are innocuous in any case.

Nathan said Monday that the agreement preserves the city’s right to assert the privilege in the future.

“Time will tell whether these documents reveal anything other than what they appear on their face to be — the proper government conduct of business concerning a civil settlement of litigation with a city contractor,” he said in a statement. “This much, however, is clear now: by upholding the principle of the District’s right to the attorney-client privilege, we have served the District’s long-term interests.”

The fight over the documents has placed Gray in a politically touchy position as he seeks a second term. Gray has said on several occasions that he played no role in the Chartered settlement decision, and his office said all decisions regarding the sharing of city documents have been made by Nathan.

“Jeff Thompson has never asked me for one thing,” Gray said as recently as last week, during an interview with WUSA-TV.

Beyond the battle with the attorney general, Machen’s probe has been delayed by a separate dispute over documents seized from Thompson’s home and ­offices in March 2012.

Thompson’s attorney, Brendan V. Sullivan Jr., has argued in court filings that prosecutors are not entitled to review some of those records and has appealed to the U.S. Supreme Court.

Although Machen has said that he is moving quickly to wrap up the investigation, the Justice Department has twice asked for an extension of the deadline to respond to Thompson.