U.S. Customs and Border Protection Commissioner Chris Magnus has resigned from his position, the White House says.

President Biden accepted Magnus's resignation letter, according to a Saturday night press release from the White House.

"The President has accepted the resignation of Christopher Magnus, the Commissioner of U.S. Customs and Border Protection. President Biden appreciates Commissioner Magnus’ nearly forty years of service and the contributions he made to police reform during his tenure as police chief in three U.S. cities. The President thanks Mr. Magnus for his service at CBP and wishes him well," White House press secretary Karine Jean-Pierre said.

In a resignation letter, Magnus said his resignation is "effective immediately."

BIDEN IMMIGRATION OFFICIAL ORDERED TO QUIT OR BE FIRED HAS 'NO PLANS TO RESIGN'

Chris Magnus grilled by Congress

Chris Magnus appears before a United States Senate Committee on Finance hearing to consider his nomination to be Commissioner of U.S. Customs and Border Protection on Oct. 19, 2021, in Washington, DC. (Rod Lamkey-Pool/Getty Images)

"Thank you for the opportunity to serve as your Senate confirmed Commissioner of U.S. Customs and Border Protection over the past year. It has been a privilege and honor to be part of your administration," Magnus said in the resignation letter shared by the White House. "I am submitting my resignation effective immediately but wish you and your administration the very best going forward. Thank you again for this tremendous opportunity."

Magnus was told to resign or be fired by Homeland Security Secretary Alejandro Mayorkas, according to a government source.

Afterward, Magnus emailed senior Customs and Border Protection staff, stating that he's determined to remain on the job.

"I want to make this clear: I have no plans to resign as CBP Commissioner. I didn’t take this job as a resume builder. I came to Washington, DC— moved my family here— because I care about this agency, its mission, and the goals of this Administration," the email obtained by Fox News states.

His resignation comes after a record-breaking year for the number of migrants attempting to enter the United States through the southern border.

TOP BIDEN IMMIGRATION OFFICIAL BEING FORCED FROM JOB AMID RECORD BORDER CROSSINGS, SOURCE SAYS

DHS Secretary Alejandro Mayorkas

DHS Secretary Alejandro Mayorkas testifies during an April 2022 House hearing (AP Photo/Jose Luis Magana)

Figures from the Department of Homeland Security show nearly 2.4 million migrants were detained at the border in the fiscal year that ended in September, which is an increase of 37% from last year.

Politico reported in October that the Customs and Border Protection commissioner fell asleep during meetings.

CLICK HERE TO GET THE FOX NEWS APP

Customs and Border Protection Commissioner Chris Magnus

Chris Magnus appears before a Senate Finance Committee hearing on his nomination to be the next U.S. Customs and Border Protection commissioner in the Dirksen Senate Office Building on Capitol Hill in Washington, DC, U.S., October 19, 2021. ( Rod Lamkey/Pool via REUTERS/File Picture)

In an October statement to Fox News, Magnus attempted to defend his performance as Customs and Border Protection commissioner.

"I care a great deal about CBP and the people who work here. In the 10 months I’ve been CBP’s Commissioner, I’ve gotten up to speed on the agency’s many complex areas of responsibility," Magnus said. "While CBP is an operational — not a policy-making — agency, I’ve been closely involved in the major DHS immigration, border security, trade, and other policy discussions throughout my time as Commissioner. I frequently share insights from CBP’s frontline law enforcement and civilian personnel in those discussions and will continue to do so."

The Department of Homeland Security didn't immediately respond to a request for comment from Fox News on the resignation.

Fox News' Bill Mears contributed to this report.