A 13-year-old Brooklyn boy was accidentally shot by his older brother Sunday, according to officials.

The shooter, Shameek Davis, 17, then fled, authorities said.

“His last words before he left the house was, ‘Make sure my little brother’s OK,’ and, ‘Call the ambulance,’ ” the boys’ cousin, Corae Lawrence, 14, told The Post.

Victim Christian Fogle suffered a wound to his leg, authorities said. He was listed in stable condition at Kings County Hospital.

Shots rang out on Hegeman Avenue near Berriman Street in East New York at around 3:35 p.m., cops said.

Shameek was dancing around the family’s living room with a .38-caliber pistol that he bought to protect his kin, when his brother startled him and the gun went off, witnesses said.

Shameek then got scared and ran off, they said.

Police confirmed the gun went off accidentally, but are still searching for Shameek.