The man who shot and killed three faculty members on Wednesday at the University of Nevada, Las Vegas, was himself a professor who had tried and failed to get several jobs at colleges in the state, the authorities said on Thursday.

The gunman, Anthony Polito, 67, was living in a Las Vegas suburb and was killed by the police during a shootout after his rampage, officials said. Mr. Polito also shot and injured a fourth person, a man identified as a 38-year-old visiting professor who was being treated at a hospital for life-threatening wounds.

Shortly before the shooting, the police said, Mr. Polito had mailed 22 letters to employees at universities across the country, at least one of which contained an unknown white powder that was later determined to be harmless. The contents of the additional letters were not clear.

Sheriff Kevin McMahill of the Las Vegas Metropolitan Police Department said Mr. Polito had used a 9-millimeter handgun to carry out the attack and brought 11 magazines with him, two of which had been emptied by the time he was killed.

The Clark County coroner’s office identified two of the people who were killed as Patricia Navarro Velez, 39, an assistant professor of accounting, and Cha Jan Chang, 64, who went by Jerry and was a professor of management information systems. Both had offices inside Frank and Estella Beam Hall, which houses the U.N.L.V. business school and where the shooting took place across several floors.

The identity of the third faculty member who was killed was being withheld until officials could notify the person’s family.

Mr. Polito taught at the business school at East Carolina University in Greenville, N.C., for nearly 16 years, until 2017. Sheriff McMahill said the police were still trying to understand the gunman’s exact motive, but that he had made a list of people he was seeking on the U.N.L.V. campus as well as at East Carolina University. None of those individuals were actually shot in the attack.

Mr. Polito was in financial trouble, and officers found a notice of eviction on his front door when they arrived at his apartment on Wednesday, the sheriff said.

The shooting rattled the campus of one of Nevada’s largest colleges — which sits just east of the Las Vegas Strip, the main casino corridor — at a time when students were preparing for final exams scheduled for next week. The police said Mr. Polito had started shooting inside the business school hall shortly before noon on Wednesday.

A U.N.L.V. police officer arrived within 78 seconds of the initial call of a shooter on campus, and more officers soon followed, immediately entering the building, officials said.

The exact movements of the officers and gunman were not clear — there were no security cameras in the hallways, the sheriff said — but the shooter eventually exited the building about 10 minutes after the first report of gunfire. There, he confronted a police officer, and the two engaged in a shootout, during which the officer fatally shot Mr. Polito, based on video that was shown at a news conference on Thursday.

Students had been exiting classes when they heard gunshots and ran to cower in classrooms with the lights turned off. The business school is in the heart of campus and sits next to the Student Union, where students were enjoying food and a Lego-building event intended to help them relax before final exams.

Sheriff McMahill noted that the gunman still had about 150 rounds of ammunition on him when he was killed, and said he believed that the gunman might have continued his attack at the Student Union had he not been stopped.

“I believe we averted a much larger tragedy by the actions of that heroic police officer,” the sheriff said.

The gunman had an address at the Promontory Point apartments in Henderson, a suburban city south of Las Vegas. On Thursday, the stucco-style buildings and apartment complex were quiet. Caution tape blocked off the section of the complex where Mr. Polito’s apartment was, next to a small pool, with two police officers standing in front of his building.

Michele Pearson, a 54-year-old occupational therapist who lives in a neighboring building, was watching “C.S.I. Vegas” on Wednesday night when she heard a SWAT team arrive at the complex. She said law enforcement officers announced on a bullhorn that they had a search warrant for the apartment number where Mr. Polito lived.

The officers called out a few times, and then Ms. Pearson heard a bang.

The apartment complex is about a 20-minute drive from U.N.L.V.’s campus, where police cruisers dotted the grounds on Thursday.

David Lenzin, 25, a computer engineering student from Calgary, Alberta, had returned to collect things from a design competition that was held by the engineering department on Wednesday. He and other students had dressed up and gotten to campus early to show off designs that they had spent a year making; Mr. Lenzin’s was a prototype of a robot that would clean surfaces.

“It’s eerie being on campus,” he said. “It’s empty. There’s cops everywhere. When you walk past people on campus, you just see crestfallen faces.”

For many students on campus — nearly 90 percent of whom are Nevadans — the shooting recalled the horrors of the 2017 attack at a country music concert just a few miles away. That shooting, the deadliest in modern American history, left 60 people dead and hundreds more injured.

U.N.L.V.’s president, Keith E. Whitfield, said on Thursday that Professor Navarro Velez joined the university about five years ago. She previously worked at PwC, the accounting firm, in Puerto Rico, and went to college at the University of Puerto Rico. She had gotten her Ph.D. in accounting at the University of Central Florida, according to her biography on the U.N.L.V. website.

Professor Chang had taught at the school for more than 20 years after receiving his Ph.D. from the University of Pittsburgh in 2001, according to his résumé. He had completed his undergraduate studies in oceanography at National Taiwan Ocean University.

Mr. Whitfield, the president, said in a statement that the shooting on Wednesday had been, in many ways, “the realization of our greatest fear.”

At a news conference, he resisted the idea of closing off the campus to the city around it.

“My inclination is not to close the campus but to see if there are other things we can do,” he said, adding that he supported the idea of adding more security cameras.

Kitty Bennett contributed research. Glenn Thrush contributed reporting.