Conservative scholar and filmmaker Dinesh D'Souza, left, and his lawyer Benjamin Brafman leave federal court in New York on May 20. (Richard Drew/AP)

Dinesh D’Souza, the conservative pundit, author and filmmaker, pleaded guilty Tuesday morning to using straw donors to make an illegal contribution to a Republican Senate candidate from New York in 2012.

His lawyer, Benjamin Brafman, released a statement Tuesday morning saying that D’Souza has “agreed to accept responsibility” for the illegal donation made in the names of two close associates. At the hearing in U.S. District Court in New York, prosecutors agreed to drop the more serious of two charges against him, leaving D’Souza liable for one count of making an illegal donation, meaning he could still receive up to two years in prison. His lawyer said that the author should not be imprisoned. A sentencing hearing is scheduled for September.

Prosecutors had alleged that D’Souza arranged in 2012 to have two friends contribute $10,000 on behalf of themselves and their spouses to the campaign of Wendy Long, a Republican who at the time was challenging Democratic Sen. Kirsten Gillibrand.

The donations were made, prosecutors said, with an understanding that D’Souza would reimburse his friends for their contributions. The result was a $20,000 contribution, exceeding the $5,000 limit on individual donations that was in place at the time. D’Souza and his lawyer had claimed that he was being targeted by prosecutors because of his consistent criticism of President Obama and liberal elites. On Tuesday, Brafman asked the court not to imprison a person who had made an isolated mistake.

“Given the technical nature of the charge, there was no viable defense,” Brafman said in a prepared statement, expressing hope that the court would “recognize Mr. D’Souza to be a fundamentally honorable man who should not be imprisoned for what was an isolated instance of wrongdoing in an otherwise productive and responsible life.”

D’Souza, whose books include “The Roots of Obama’s Rage,” went to Dartmouth College with Long and he co-hosted a fundraiser for her during the campaign.

In his 2010 book on Obama, D’Souza theorized that the president is motivated largely by the “inherited rage” of his absent Kenyan father. Long, a former clerk to Supreme Court Justice Clarence Thomas, and D’Souza worked together on the Dartmouth Review, famous for its outspoken views on social and political topics.

Prosecutors for the Southern District of New York said the indictment was the result of a routine review by the FBI of campaign filings by various candidates after the 2012 election.