SAN JOSE -- Finally moving to get his legal transgressions behind him, 49ers linebacker Aldon Smith backed off his previously defiant stance Wednesday, pleading no contest to misdemeanor DUI and three felony counts of possessing illegal assault rifles.

Smith is set to be sentenced July 25, two days after the 49ers report for training camp in Santa Clara. Although prosecutors say they did not offer him a lighter sentence in exchange for switching his plea from not guilty to no contest, Smith can hope for leniency from Judge Daniel T. Nishigaya. The early plea allows the court to avoid the time and cost of what would have been two separate trials for the unrelated DUI and gun possession incidents.

Smith now faces a range of possible punishments, from a slap on the wrist to serious jail time, in addition to whatever punishment the league hands out.

"It's from zero days (in county jail) to four years and four months," prosecutor Brian Buckelew said outside court Wednesday after Smith entered his new plea. "(But) there is an acceptance of responsibility here that gets factored in by the sentencing judge."

As recently as last week, the talented 24-year-old who has tallied a staggering 42 sacks over his first 43 NFL games appeared to be balking at accepting a conviction. He said in an interview with Comcast that he is not a thug, and "a lot of these things are being painted in a picture that's not true." He appeared only briefly in court Wednesday, saying "Yes, your Honor," repeatedly in reference to his desire to change his plea, before being whisked out a back door under court security.

His lawyer, Josh Bentley, issued a brief statement late Wednesday, saying "Aldon has never wavered from his commitment to do the right thing in this case. Aldon has accepted and continues to accept responsibility for his actions. We are looking forward to the next court appearance and are confident that the court will reach an appropriate sentence."

Assuming Smith avoids substantial jail time, the resolution will clear the way for the NFL, the 49ers or both to issue potential punishment to Smith early in the season, which starts in September, meaning he could return for the team's fourth straight playoff push.

If past cases are any indication, a suspension could range from one to four games, though the league has also imposed eight-game, full-season and indefinite suspensions of players for off-field conduct since 2007.

Also, the Los Angeles City Attorney's Office is still weighing whether to charge Smith with a misdemeanor for allegedly making a false bomb threat at the Los Angeles airport in April. Smith has denied using the word "bomb" during a random second screening by a TSA agent.

The three illegal assault rifles were discovered in 2012 after gang members crashed a party at Smith's house, stabbing him and shooting other guests. In September, he hit a tree early in the morning near his house in the East San Jose hills and was arrested on suspicion of drunken driving. He pleaded no contest to two misdemeanor DUI charges, including basic drunken driving and a separate count of driving with a blood-alcohol level nearly twice the legal limit. He also pleaded no contest to an infraction for having the wrong license plate on his vehicle.

The typical sentence for a first-time DUI conviction is six days on a weekend work crew. But in Smith's case, prosecutors have said there are three aggravating factors that could put him in jail for up to six months: He was involved in a collision (with the tree); his blood-alcohol level was nearly twice the legal limit; and he has a previous arrest in Florida for drunken driving. However, he also spent about six weeks in a substance abuse treatment program last year, missing five games.

Smith may be able to avoid being labeled a felon for the rest of his life by asking the judge to have the three felony counts reduced to misdemeanors. Regardless of the judge's decision, the felonies do not count as serious or violent "strike" crimes under the state's Three Strikes Law.

Despite Smith's run-ins with the law, 49ers general manager Trent Baalke gave the thumbs-up earlier this month for the team to pick up the embattled linebacker's 2015 option, citing his commitment to a "humanistic" approach. Wednesday, Baalke said, "Today was an important step towards bringing that situation to a resolution."

The team has had nine arrests since 2012, the most in the NFL during that span, according to a review conducted by this newspaper. Four of those arrests came courtesy of Smith. In 2012, Smith was arrested in Miami Beach on suspicion of driving under the influence. He qualified for a diversion program for first-time offenders and charges were reduced to reckless driving.

Contact Tracey Kaplan at 408-278-3482. Follow her at Twitter.com/tkaplanreport.