The morning after pill has been made available to students at a California university via a vending machine on campus.

The University of California Davis has installed the Wellness To Go machine, which dispenses condoms and tampons as well as emergency contraception, in its study room.

Its installation is the brainchild of senior UC Davis student Parteek Singh, 21, who pushed for its availability for two years.

"I think these are just basic resources that students need on campuses," Singh told Breitbart. "Most college students are sexually active ... and these resources should be provided to them."

He added in an interview with CBS that the idea had come to him after seeing how problematic it could be for people to locate the morning after pill.

"There was an incident where my friends went to the one pharmacy in town on a Friday night and they were all out of emergency contraception," he explained. "I want to see this on every college campus."

His successful lobbying of the university to include the $30-a-pop Plan B tablets in a university vending machine has seen him contacted by students from other US universities who want to see the same emergency contraception made available in their establishments.

But opinion on the vending machine has been split – with some students praising the move and others questioning whether the morning after pill should be so readily available.

Student Jordan Herrera told KTXL: "It is promoting like 'Oh hey, go and have unsafe sex because then you have a backup option and it's gonna be cheaper than if you just wanna go to a drug store'."

UC Davis did not immediately respond to a request for comment.