Zach Jackson scored 15 points in the final period on his way to 24 on the night, leading the Riders' charge from 12 down to lead by two points with nine seconds remaining.
But Desmond Robinson hit the game winner for Bristol from three, and Jackson's attempt on the buzzer hit the rim to send Leicester home empty-handed.
Riders struggled on offence, shooting 6-23 from three, but still managed to keep it close through to the final buzzer.
The defeat gives Riders a 15-7 record in the SLB Championship, a month from the post-season action.
Slow shooting start
It was a difficult offensive start for both sides. They started a combined 3-10 from the field, managing nine points between them through five minutes.
Riders, struggling with their outside shooting, turned to their big man in the paint as Charles Thompson got going with back-to-back scores.
Two blocks on Keddy Johnson and an Owen McCormack steal were his defensive contributions in the first quarter the bright spark in a tough start to the game.
Thompson finished with a career-high seven blocks on the night.
Flyers' defence held Leicester to looks deep in the shot clock as the visitors struggled to click into gear.
Meanwhile, a 7-0 Bristol run gave them an advantage in the period, which ended 13-9 to the hosts led by six points from Raphell Thomas-Edwards, making his return from injury.
Shelton run brings Riders back
Bristol's shooting struggles kept Leicester in contention. They started 3-11 and 1-5 from deep despite their five-point lead.
J'Raan Brooks took the lid off from three for Leicester in the second, allowing them to battle back into the lead.
They won the first three minutes of the quarter 10-3, snatching the lead with a Duke Shelton three - the first of his British career.
Shelton's three injected confidence into the American big man, who scored eight straight points to build Riders' lead, making him the team's leading scorer in the half.
Offensive boards costs Riders lead
Kendall Lewis, also making his return to action for the Flyers, made an and-one play on the third time of asking to swing momentum back into their corner.
They regained the lead in a low-scoring half through Robinson at the rim with two minutes remaining in the half.
Offensive boards were a theme of the end to the period to maintain the Flyers' narrow lead. They grabbed four in as many minutes, and finished the half with a drive to the rim from Keddy Johnson to take a 32-29 advantage into the break.
Leicester continued to struggle for good offensive looks to start the second half.
They started 0-4, again forced to throw up shots deep in the shot clock, and scored their first points on the fastbreak three minutes in through Jaylin Hunter.
On the other end, a Lewis three and Keddy Johnson's fastbreak jam forced a Riders timeout trailing 38-31.
...