A shooting on a US university campus has left one person dead and a suspect in custody.

Police provided few details as to why the man opened fire in a Purdue University classroom in the Midwestern state of Indiana on Tuesday, but they said they believe he knew his victim.

The attacker surrendered himself within minutes of the attack in the, officials said.

"There's a lot of investigation on hand," John Cox, Purdue university police chief, said.

Police did not release the name of the male student who was killed or of the suspect. The university reported that the shooting took place in the electrical engineering building at noon.

"The individual entered the facility and took the actions that he took, and then immediately left the facility without any other interaction that we're aware of," Cox said.

The suspect gave himself up to a West Lafayette police officer outside the building on the 40,000-student campus, Cox said.

He said the man arrested was not immediately cooperating with investigators.

Purdue officials issued a text alert telling those on the campus about 96km northwest of Indianapolis to seek shelter shortly after the shooting was reported.

Within two hours, the university said there was no ongoing threat on campus and allowed normal operations to resume in all buildings except the engineering facility where the incident took place.

The attack came on the heels of at least two school shootings in the US last week, one in Philadelphia that left two teenagers wounded and another in New Mexico that injured an 11-year-old boy and a 13-year-old girl.

The campus in West Lafayette, Indiana, serves nearly 40,000 students. Purdue employs more than 15,000 faculty and staff members.

"Today's shooting at Purdue University is a tragedy, and our heartfelt condolences go out to the family of the victim and to everyone in the Purdue community," Mike Pence, Indiana governor, said in a statement.