It was the phone call police in Philadelphia most dread: an officer shot while on patrol.

In a city that has seen more than its share of police killings in recent years, the department's leaders were grimly prepared. Sometime after 4 a.m. on April 5, after Sgt. Robert Ralston was taken to the Hospital of the University of Pennsylvania with a shoulder wound, the department's top brass rushed to his side, including Police Commissioner Charles H. Ramsey, who was sick with a stomach virus.

Ralston's injury turned out to be minor. But when he started telling the tale of his brush with disaster, the story raised red flags almost immediately.

Ralston, 46, said he had been shot in West Philadelphia by a black man who pointed a revolver at his head, then grazed him in the shoulder when Ralston knocked the gun away. He said he had returned fire and hit the man in the chest, but no gunshot victim turned up at a hospital.

When Ralston called his children to report what had happened, one police officer at the hospital said Ralston seemed eager to appear heroic.

And within hours of the shooting, Ralston got out of his hospital bed, picked up his bloodied shirt, and put it back on. He then returned to the scene to help with the investigation.

"It was strange," said Deputy Commissioner William Blackburn. "His reactions didn't add up."

Over the next few weeks, as police searched the scene and the neighborhood for clues, Ralston's tale continued to unravel. Gunpowder residue found on Ralston's shirt matched the ammunition in his own service weapon and suggested he was shot at point-blank range. Ralston made mistakes when describing the layout of the area where the shooting took place. And though Ralston was adamant he had shot the assailant, no blood was found at the scene.

Around 4 a.m. Tuesday, after four hours of questioning by detectives at Police Headquarters, Ralston admitted he had shot himself, fabricated the story, and made the false report.

Ramsey, who announced the officer's admission five hours later at a hastily called news conference, called the incident "a terrible and embarrassing chapter in our history."

John McNesby, president of the Fraternal Order of Police Lodge 5, who also had raced to the hospital to meet with Ralston when he was shot last month, expressed disgust.

"The community has supported this city's police officers through so much, every time we lose an officer," McNesby said. "To have something like this come along that could possibly tear that down is a disgrace."

Ralston, a married father of five and a 21-year veteran of the department, was suspended Tuesday with intent to dismiss. He will be off the force officially in a month, and his badge number will be retired, so no officer will ever share the number with him.

Ralston will not face criminal charges because he was offered immunity from prosecution in exchange for his confession. That means he will most likely receive his pension, Ramsey said.

"It was the only way we could tie this up," Ramsey said of the arrangement.

Ralston's pension has not yet been calculated, but a city official estimated that he would collect about $24,000 annually if he took his pension now.

Some of that may be used to recoup the expense of the massive manhunt sparked by his lies, Ramsey said. Police spent hours combing the West Philadelphia neighborhood for possible suspects in the shooting, and the department has not yet calculated how much the investigation cost.

Rumors had circulated in the department for weeks that Ralston made up the story. Some sources speculated that he wanted attention, commendation from the department, or a transfer to another district. Ramsey said he did not know why Ralston had made up the story.

"The big question in everybody's minds is why," said Chief Inspector Anthony DiLacqua of Internal Affairs. "There's only one person who knows the answer to that."

Ralston could not be reached for comment. There was no answer at the door of his home in Northeast Philadelphia.

Ralston was hired in March 1989. He was promoted to sergeant in 2007, and last year was paid $65,424.

He spent much of his career working in the 25th District in North Philadelphia. In 1995, after he was named in a complaint, an investigator found that Ralston had hit a suspect on the head while arresting him, and that he had mishandled other aspects of the arrest.

Sometime after 2003, Ralston went to the relatively quiet Fourth District, which covers part of South Philadelphia. He recently was transferred to the busier, West Philadelphia-based 19th District, a move that police sources said Ralston was unhappy about.

Ralston was patrolling near 56th Street and Lancaster Avenue, in the Overbrook section, early April 5. Police were investigating a string of burglaries at a strip mall in the area, and Ralston told police he was on the lookout for anything suspicious.

He said he saw two men on the railroad tracks and tried to stop them, but one ran and the other drew a silver revolver and put it to Ralston's head. Ralston told police he had smacked the gun out of the way, but it went off and grazed him. At the time, officials said Ralston's quick reaction might have saved his life.

Ralston told police the assailant was a black man with his hair in corn rows. He had a mark or tattoo under his left eye, according to Ralston.

Ramsey said Ralston apparently described his assailant as black because the area where the shooting took place is predominantly African American.

"It's troubling in a lot of ways," Ramsey said. "It inflames racial tensions in our community, and that's certainly something we don't need."

Ramsey said it was fortunate that officers never stopped or arrested anyone matching Ralston's description of the gunman.

Officers with dogs searched along the tracks and woods at 52d and Lancaster, and knocked on doors in the neighborhood looking for people who might have heard or seen something. The FOP posted a $10,000 reward for information leading to the suspect's arrest.

From the start, police said, the facts of Ralston's story did not add up. But there was little evidence found that could disprove his story, either. No one witnessed the shooting. There were no surveillance cameras close by, and the incident took place in an area that is relatively desolate even in daylight hours.

"Putting the truth together took a great deal of effort," DiLacqua said.

In the end, police concluded that they could not charge Ralston unless he confessed.

District Attorney Seth Williams praised Ramsey's swift move to fire Ralston.

"We took a badge and a gun from a person whose actions proved him unfit for either. . . . Ultimately our goal was to get to the truth," Williams said in a statement. "Unfortunately, we could only arrive at the truth through his statement given to the police, and that statement cannot be used against him."