In the span of less than a week, the long-term sponsor outlook of JR Motorsports dramatically has shifted from potentially bleak to firmly bright.

On the heels of NASCAR phenom William Byron being added to the Xfinity Series team for the 2017 season (as part of a multiyear deal with Hendrick Motorsports), JRM announced Wednesday that sponsor OneMain has reversed course and decided to remain on Elliott Sadler’s No. 1 Chevrolet.

“When we found out this was going to happen, my wife and I just cried that whole morning tears of joy knowing there’s so much stability,” Sadler, 41, told NBC Sports. “It’s been a great couple of days.”

OneMain, which initially had informed JRM nearly two months ago of its plan to leave NASCAR, will sponsor Sadler for 20 races in each of the next two seasons, JRM general manager Kelley Earnhardt Miller said.

The team that she co-owns with her brother Dale Earnhardt Jr. will field three full-time entries in Xfinity next year for Byron, Sadler and Justin Allgaier (who will return with backing from Brandt). JRM is planning a fourth car for several races with a rotating cast of Sprint Cup drivers.

“We’ve been trying to get in front of sponsorship sooner and sooner,” Earnhardt Miller told NBC Sports. “This is the first year of our existence that we can say before the end of August that we have three full-time teams competing with probably 90 percent of that sponsorship in place.

“It’s a great place for us to be. It’s just a sign that things are coming around, and people like our sport, so it’s a great position for us. It’s the first time I can say, ‘Hey, we’ve got a two-year plan.’ This is the highest car count we’ve had for so long, and it’s just a lot of excitement for us.”

Since 2010, JRM’s staff has grown from 74 to a current high of 144 employees, but it’s had to scrape through some precarious financial situations. The deal for Chase Elliott’s 2014 championship as a rookie came together only two months before the season, and Earnhardt Miller said the team, which has fielded full-time Xfinity cars since 2007, has arrived at season openers in Daytona with only one car fully funded.

Now the future is much more secure. Though OneMain is reducing its commitment from 33 to 20 races, Earnhardt Miller said several other races have been sold for Sadler’s car next year with only a handful left to fill.

Sponsorship hasn’t been signed yet for Byron, but Earnhardt Miller said the team is hopeful of him retaining Liberty University, which has sponsored his record rookie season (five wins) in the Camping World Truck Series and also sponsored his Late Model car at JRM. While it’s uncertain if the school could sponsor a full season, Earnhardt Miller said the team has “some other things in the hopper” for Byron’s car.

Having a solid driver lineup also should help JRM in meetings scheduled with prospective companies next month.

“We can go into situations with sponsors and say, ‘How about this for an opportunity?’ when so many times, I’ve been selling the sponsorship the other way, where we’re going to them and saying, ‘we don’t have a driver named,’” Earnhardt Miller said. “So it feels good to say, ‘These three guys are our drivers, here’s where we have openings and does this fit what you’re looking for?’ ”

As part of the OneMain deal, Sadler has agreed to a two-year extension with JRM, ending concerns that the loss of sponsorship could threaten his NASCAR career.

The Emporia, Va., driver has been sponsored since 2011 by the financial services company, which was sold last year by Citigroup to Springleaf Holdings.

“We are thrilled to continue our partnership with Elliott Sadler and JR Motorsports,” said Bob Hurzeler, OneMain executive vice president and chief operating officer, in a release. “After further evaluation of the program, we felt this relationship was a perfect fit for our company. Elliott has been an outstanding ambassador for OneMain and we look forward to our continued success with Elliott and JRM, on and off the track.”

After JRM was informed June 30 that OneMain would be leaving, Sadler said there were several signs the company was reconsidering its decision. The points leader began receiving calls on Mondays and Tuesdays from “people I didn’t really know two or three months ago” complimenting the team’s recent performances.

“There were a lot of new decision-makers coming in as part of the merger, and a lot of them hadn’t been to a race yet or watched racing or knew the data,” Sadler told NBC Sports. “Once all those guys started coming to races, they were like, ‘Hey this is neat.’ I was very proud of them reconsidering and looking at the numbers that the NASCAR fan does line up with their customer base. The more they looked at it, the more they became fans of it. They realized how big a sport we really are, and that we really do reach a big part of United States.”

Earnhardt Miller said the OneMain deal was finalized late last week after a month of negotiations. “The new OneMain felt that the NASCAR demographics and audience would be a great place to share their rebranding and the relationship they have had so long with Elliott,” she said. “So they revisited it essentially and decided this is what they wanted to do.”

Sadler feels his recent run of seven consecutive top 10s – his best stretch of the season – also helped cinch the deal. He already had qualified for the inaugural Xfinity championship playoff with his victory at Talladega Superspeedway.

“Anytime you can perform on the racetrack is a good thing,” he said. “I told Kelley I absolutely love this race team and the position I’m in, and this year I felt like I’ve found the Fountain of Youth.

“Kelley and Dale and I have known each other almost 20 years. I’ve felt so comfortable being with this race team. Personally, we’re invested in each other’s future. It feels good to run good for someone you have a great relationship with, and this was the only situation I felt really comfortable being part of and have the best chance of winning.”