Rapper Lil’ Kim escaped a stiff prison sentence Wednesday after telling a judge she was a “God-fearing good person” who regretted lying to a federal grand jury about a 2001 shootout outside a Manhattan radio station.

The Grammy winner was sentenced to one year and one day for perjury and conspiracy — a term far less than the three years and seven months sought by prosecutors.

U.S. District Judge Gerard Lynch said he had weighed the public perception of sending a young black entertainer to prison far longer than Martha Stewart, who spent five months in prison and remains under house arrest after a false statements conviction.

Lynch suggested Lil’ Kim (real name: Kimberly Jones) deserved more time because she had lied about a violent crime, not a white-collar scheme. He also noted that unlike Stewart, she took the witness stand at her trial earlier this year and repeated her lies.

“You sat right next to me there and stared in the eyes of the jurors, and you tried to charm them and you tried to fake them out,” Lynch said.

But the judge also credited Lil’ Kim with returning to court Wednesday and admitting she had lied all along to protect members of her entourage.

“At the time I thought it was the right thing to do, but I now know it was wrong,” she said, her voice breaking.

Lil’ Kim said she wanted to “take complete blame” for the actions of her assistant, Monique Dopwell, who’s awaiting sentencing for the same crimes.

She also asked the judge “to consider my entire life’s work and not just the days in the grand jury and on the witness stand in the courtroom. I’m a God-fearing, good person.”

Lil’ Kim, who was ordered to report to prison Sept. 19, left the courthouse without speaking to reporters.

Some fans who showed up outside said they were relieved that the sentence wasn’t harsher.

“I’m just excited ’cause it’s not that long,” said Alfredo Borbon, 22, a waiter who wore a pair of boots with the rapper’s name on them. “We can wait; us fans can wait that long.”

The artist, who turns 30 next week, was the sidekick and mistress of the late Notorious B.I.G. As a solo artist, she has become known for her revealing outfits and raunchy lyrics.

The case stemmed from a gun battle that erupted outside WQHT-FM, known as Hot 97, when Lil’ Kim’s entourage crossed paths with a rival rap group, Capone-N-Noreaga.

Lil’ Kim’s group confronted the others about the Capone-N-Noreaga song “Bang, Bang,” which contained an insult to Lil’ Kim from rival Foxy Brown. One man was hurt in the shootout that followed.

Before the grand jury and at the trial, the rapper claimed she did not notice two of her close friends at the scene of the shootout — her manager, Damion Butler, and Suif Jackson, known as “Gutta.” Both have pleaded guilty to gun charges.

Jurors at Lil’ Kim’s trial saw radio station security photos that depicted Butler opening a door for the rap star, and two witnesses who once made records with Lil’ Kim said they saw her at the station with Butler and Jackson.