PORTLAND (AP) — A Maine man who had seven guns and more than 2,000 rounds of ammunition in his apartment above a child care center is going to prison for nine years.

A federal judge imposed the sentence Wednesday on 27-year-old David Widi of Eliot for illegal possession of firearms and ammunition and manufacturing marijuana.

U.S. Attorney Thomas Delahanty II says the judge took into account that Widi committed perjury and threatened a government witness testifying during his trial in April.

Widi was prohibited by federal law from possessing firearms because of a felony conviction in New Hampshire. He was convicted in 2004 of reckless conduct for allegedly driving his pickup truck at two people in Portsmouth, N.H.