New York Gov. Andrew M. Cuomo (D) will receive a total of $5.1 million for his book on the coronavirus pandemic, a contract driven by his national profile during the worst days of the virus and now seen through the prism of an investigation into his use of advisers to write the book.

The book, “American Crisis: Leadership Lessons from the Covid-19 Pandemic,” was released in October. According to Rich Azzopardi, Cuomo’s director of communications and senior adviser, the book contract “calls for payment of $3,120,000 in the last taxable year and an additional $2 million over the following 2 years.” Details of the contract emerged Monday as Cuomo released his 2020 tax filings.

According to Azzopardi, Cuomo received $1,537,508 from the $3,120,000 after expenses and taxes. Of that amount, Cuomo donated one-third to the United Way of New York State for “statewide covid relief and vaccination effort,” Azzopardi said. The remainder will go into a trust for Cuomo’s three daughters.

In a letter to Cuomo dated Monday, United Way expressed “our sincere gratitude to you for such an extraordinary and generous contribution of $500,000.” The timing of Cuomo’s donation was not immediately clear.

Cuomo aides worked on the $5.1 million book extensively, with many spending time in his office and in the mansion on the project. In one version of the book reviewed by The Washington Post, a Cuomo aide is asked to print a draft of the book labeled “MDR edits” — the initials of the governor’s top aide, Melissa DeRosa.

The governor asked a number of advisers, including top state officials, to spend scores of hours to help write the book, even as the coronavirus raged through the state, four people previously told The Post.

A number of Cuomo’s aides disagreed with the decision to write a book during the pandemic, saying it could be viewed as inappropriately timed and political, two people said. Azzopardi last month told The Post that it was “not true” that aides at the time said the project was not a good idea.

DeRosa was most involved in writing the book with Cuomo, while also running the governor’s office, people familiar with the matter said. Other aides who worked in the governor’s office were asked to print drafts of the book on government computers, according to the people with knowledge of the situation.

Cuomo is under investigation by the New York State Assembly, the New York attorney general’s office and the FBI for alleged sexual misconduct as well as his administration’s alleged mishandling of data related to covid-19 deaths in the state’s nursing homes. The governor has denied any wrongdoing and rebuffed calls for his resignation.

Cuomo has come under fire after nursing homes in the state accepted coronavirus-positive patients under a controversial directive from his administration. More than 9,000 recovering coronavirus patients were transferred to nursing homes early in the pandemic, the Associated Press reported.

New York Attorney General Letitia James (D) in late January reported that nursing home resident deaths were “undercounted” by as much as 50 percent. Shortly after, the state’s reported death toll of nursing home residents increased by thousands when the health department shared more than 3,800 residents had died in hospitals.

Meryl Kornfield contributed to this report.