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 the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.