Then-President Barack Obama (above) delivers 2016 commencement address at Rutgers University in Piscataway, New Jersey

Rutgers University spent nearly $1.5million on its 2016 commencement ceremony because of that year's keynote speaker, then-President Barack Obama.

The hefty price tag is $523,000 more than it cost the university the year before, when its commencement speaker was Bill Nye 'The Science Guy,' according to NJ Advance Media.

A final accounting by the university found that most of the money was spent on the extensive security measures needed to accommodate the president as well as the record crowd that witnessed the event at the school's football stadium in Piscataway, New Jersey.

The university used the funds to pay for more police officers, a traffic safety consultant, road closures, chair rentals, and food for the volunteers who helped set up the commencement ceremony.

'President Obama came to Rutgers and told the world that America converges here,' a Rutgers spokesperson, Karen Smith, said.

'We couldn't be more proud of his visit. His commencement address - the first in Rutgers history by a sitting president - was a unique opportunity for the university to showcase itself on a national stage.'

New Jersey's public university invited Obama to deliver the commencement address after students enrolled in the school flooded the White House for three years with letters asking the former president to give the speech.

Obama's speech as the school marked its 250th anniversary.

In 2015, Rutgers booked Bill Nye 'The Science Guy' to give the commencement - at over $500,000 less than what it cost for Obama

'In 2016, about 52,000 people - nearly 50 per cent more than the previous year - attended the event,' Smith said.

'The difference in costs reflects additional expenses to accommodate the crowd, ranging from extra buses to additional rental chairs and programs.'

To prepare for the event, Rutgers paid a number of vendors.

Mountain Productions, a company based in Pennsylvania, was paid $450,975 for services.

The university also paid $103,293 to Traffic Safety Services for the planning of road closures and parking.

It also paid $131,042 to Academy Bus and First Transit, which provided transportation to those attending the ceremony.

There was also the tens of thousands of dollars that the university paid to state police as well as smaller, local law enforcement agencies who secured the event.

There is no information available regarding the accounting for the costs of flying Obama to Piscataway by helicopter.

Nor do we know how much it cost the Secret Service to secure the event.

Interestingly enough, Rutgers normally pays commencement speakers $35,000 to give their speech.

Obama, however, spoke for free.