TMZ/Getty

Tory Lanez Felony Assault Charge in Megan Thee Stallion Shooting

Tory Lanez has been charged in connection with the shooting involving Megan Thee Stallion ... just weeks after the singer released an album claiming his innocence.

The L.A. County D.A.'s Office hit him with one count of assault with a semiautomatic firearm, and one count of carrying a loaded, unregistered firearm in a vehicle. The D.A. also alleges Tory inflicted great bodily injury.

If convicted, the rapper/singer faces up to 22 years and 8 months in prison.

As we reported ... the prosecutors had said they were mulling over a charge of felony assault with a firearm against Tory after Megan said she was shot back in July. Remember, Tory had been arrested but only charged with possession of a firearm. Prosecutors are now explicitly pointing the finger at Tory as the man who pulled the trigger ... leaving Meg with a gruesome foot injury.

It took Meg some time before she went public and accused Tory by name as the person who shot her. She didn't mince words saying ... "Yes, this n***a Tory shot me. You shot me, and you got your publicist and your people to these blogs lying and s**t, stop lying!"

As we reported, sources connected to Tory say there were mitigating circumstances -- and based on what we know ... we believe Tory's going to say it was an accidental shooting. Megan didn't help the D.A.'s effort with a social media caption -- which has since been deleted -- that said she had her back to the SUV when she was shot in the heel. That might indicate she didn't see it with her own eyes when Tory allegedly pulled the trigger.

You'll recall ... video of the incident showed cops pulling over the SUV in the Hollywood Hills -- with Tory lying face-down on the pavement and Megan gingerly tip-toeing ... leaving bloody footprints with each painful step.

TMZ.com

We broke the story ... Megan's injuries to her feet were so bad she had to go into the operating room to remove bullets or bullet fragments.

Click here for info about our online advertising practices.