Ricardo Burgos, a little-known Chicago artist who performs under the name Nation, brandished two guns as he rapped "about selling drugs, committing acts of violence and disrespecting law enforcement," prosecutors said in a statement.
While the United States has some of the world's most lax restrictions on guns, felons are forbidden from owning weapons.
Burgos was previously convicted of selling crack cocaine and heroin.
He pleaded guilty Tuesday and was sentenced to 188 months in prison by Judge Robert Guzman at a federal court in Chicago.
Prosecutors said one of the guns in the video was a .45-caliber semi-automatic pistol that had been stolen from a store in neighboring Indiana. It was used in a Chicago shooting before he recorded the video.
While US federal law prohibits felons from owning guns, states can reinstate firearm rights -- and have increasingly done so, with support from the powerful pro-gun lobby.
A total of 5,768 felons were convicted of firearms possession in 2012, according to the US Sentencing Commission.
The average sentence that year, the last for which statistics were available, varied widely but averaged 75 months, according to the federal commission.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.