Police shot and wounded a 25-year-old gunman in West Philadelphia early Thursday and then followed a blood trail to a second man riddled with bullets nearby, authorities said.

Detectives also were investigating two fatal shootings that occurred Wednesday night and Thursday morning.

The two men shot in West Philadelphia were reported in critical condition at the Hospital of the University of Pennsylvania.

Police were called to the 100 block of North Dearborn Street about 2:45 a.m. for a report of gunfire.

The first arriving officer saw a man at 51st and Race Streets, waving a gun and shouting.

The officer told the man to drop the weapon and fired five times when the man refused and fled, police said.

A second officer confronted the gunman on Dearborn and fired twice when the man turned and pointed the weapon at him, police said. The gunman was hit in the chest and collapsed. Police recovered a .380-caliber handgun.

A short time later, officers followed a blood trail from a house on the 100 block of Dearborn to 110 N. 51st St., where they found the second man on the porch, police said.

The officers who fired their weapons have been placed on restricted duty while Internal Affairs investigates, which is standard procedure.

About 3:10 a.m. Thursday, two men with semiautomatic rifles fatally wounded a 22-year-old man on the 1200 block of South 21st Street in Point Breeze, police said.

Witnesses told police that the gunmen had run out from Titan Street and then fired on a man standing with a group of people.

The victim fled, but was hit in a leg, his chest, and his back. He was pronounced dead at HUP at 4:48 a.m., police said.

Officers on patrol before 10 p.m. Wednesday heard three gunshots and saw a crowd running from the 1600 block of West York Street in North Philadelphia, police said.

On the street they found Kareem Shaw, 19, a resident of the block, with a gunshot wound to the back. He died at 10:10 p.m. at Temple University Hospital, police said.

Contact staff writer Robert Moran at 215-854-5983 or bmoran@phillynews.com.