PISCATAWAY -- President Barack Obama will speak at Rutgers University's 250th anniversary commencement, the White House announced Thursday.

The announcement comes more than two years after Rutgers President Robert Barchi wrote to Obama asking him to speak to the graduating class. This year's graduation ceremony is on May 15 at High Point Solutions Stadium in Piscataway.

President Barack Obama delivers remarks earlier this month at the 2016 White House Science Fair. (Michael Reynolds | EPA)

"Rutgers University is one of the oldest universities in the country with a long and distinguished history of advancing research and preparing students with the skills they need to succeed in the new economy," White House spokesman Keith Maley said in a statement announcing the trip.

Barchi wrote to Obama in the fall of 2013, saying he couldn't imagine a more inspirational commencement speaker. Obama speaks at only a few commencement ceremonies each year and Rutgers has no record of a sitting U.S. president speaking at its graduation, according to the university.

"We are delighted that President Obama has chosen to address our graduates at this year's historic commencement," Barchi said in a statement Thursday.

Obama's decision to visit Rutgers is a testament to the efforts of students, faculty, alumni and New Jersey elected officials who sent messages to the White House, Barchi said.

Rutgers learned Obama would be speaking on Wednesday, when Barchi's office received a phone call from the White House, said Peter McDonough, Rutgers' senior vice president for external affairs.

The university is in the early stages of working with the White House to coordinate the logistics for commencement day, he said.

"It's all very very early for a very big event," McDonough said. "It will take a while to plan."

Hope among students that Obama would speak had faded last week when the university Board of Governors approved veteran broadcast journalist Bill Moyers as a graduation speaker.

"I only knew who this was because my grandmother told me," Alexandra M. Williams, the student representative on the board said at the time.

Moyers will attend Rutgers's commencement and receive an honorary degree Barchi said. He will still receive his $35,000 speaking fee and deliver an address at the School of Arts and Sciences convocation, according to the university.

Obama's trip to New Jersey will be his fourth in less than two years.

He previously spoke at Joint Base McGuire-Dix-Lakehurst to mark the end of U.S. combat operations overseas, in Camden to discuss community policing, and in Newark to talk about overhauling the criminal justice system and provide alternatives to incarceration for nonviolent offenders.

Obama will also speak at the commencement ceremonies at Howard University and the United States Air Force Academy, according to the White House.

Jonathan D. Salant contributed to this report

Adam Clark may be reached at adam_clark@njadvancemedia.com. Follow him on twitter at @realAdamClark. Find NJ.com on Facebook.