The teenager accused of gunning down 19 people during Sunday’s second-line parade was caught two months earlier, allegedly carrying a handgun with an extended clip and a bag of heroin.

Akein Scott, 19, was arrested March 5 outside a corner store at North Derbigny and Frenchmen streets, just three blocks from Sunday’s vicious shooting.

As four of the 19 injured remain hospitalized, three in critical condition and another listed as stable, police continue to search for the alleged gunman.

Scott lived two dozen blocks away, on North Roman Street in the Upper Ninth Ward, according to court records.

In March, two police officers patrolling in the 7th Ward spotted him sitting outside a corner store just before 10 a.m., according to court records.

He saw them, the officers wrote, and immediately stood up and walked inside. The cops, citing their experience, wrote in their report that they believed he was armed. They followed him into the crowded corner store and brought him back outside.

One officer “immediately observed a bulge in the waistband of the subject,” and suspected he had a gun stashed there. The officers found a black handgun with an extended magazine, which turned out to be stolen from St. Charles Parish.

Scott tried to flee as officers put him in handcuffs.

When they arrived at the central booking, the officer found a plastic bag containing an off-white substance, which they suspected was heroin, stashed under the back seat of the police cruiser. Scott had tried to hide it there, the officers suspected.

He was booked on six counts: possession of an illegally concealed weapon, possession of a stolen firearm, possession of heroin, resisting arrest, possession of contraband and, the most serious charge, possession of a gun while in possession of a controlled dangerous substance, a high-end gun felony punishable by five to 15 years in prison.

Scott did not have a lengthy criminal history — he had been arrested twice before. In early 2012, he pleaded guilty to a misdemeanor simple battery charge.

Not long after, he was again arrested for a gun charge after a traffic stop.

According to a source in the criminal justice system, Scott was in a car stopped by the Louisiana State Police in February 2012. Troopers discovered a gun, stolen three years earlier from Slidell, inside the car. He was booked with illegal possession of a stolen firearm.

District Attorney Leon Cannizzaro last April declined to pursue that charge.

After Scott was arrested on the six counts in March, Orleans Parish Magistrate Commissioner Harry Cantrell set a total bond at $35,000, and Scott remained in jail. His bond was split between four of the six counts: $15,000 on the concealed weapon charge, $10,000 on the stolen firearm count, $5,000 for the heroin and another $5,000 for resisting arrest.

Cantrell found no probable cause for the other two charges: the felony guns and drugs and contraband charges.

But when the district attorney charged Scott on April 22, he pursued only the most serious charge — possession of a firearm while in possession of controlled dangerous substances. The other five counts were refused.

When police officers arrest a suspect, they often pile on as many charges as possible, some of which are repetitive. The district attorney commonly picks only one or two of the most serious charges to pursue.

Typically, since Cantrell had not set a bond on the guns and drugs charge, a new bond would have been set. But for Scott, the $15,000 bond previously set for the misdemeanor concealed weapons charge was transferred by the clerk’s office as the bond for the felony, according to court records.

Scott posted the bond through a bail bondsman and was released April 30.

He was scheduled to appear in court this Thursday. He remains on the lam.

His photograph and videos of Sunday’s shooting have made national news, and Crimestoppers is offering a $10,000 reward for information.