CLEARWATER, Fla. — The sting of being outbid for Manny Machado proved to be enough motivation for the Phillies to heighten their pursuit of Bryce Harper, and a source said Thursday afternoon that they are confident they will sign the superstar outfielder.

The Phillies began the offseason with the expectation that they would sign Harper or Machado. They met with both players over the winter, as the free-agent market plodded on. Those expectations have not changed, the source said, even with Harper as the last superstar standing.

The Phillies were interested in Machado but did not prove to be aggressive enough, as the Padres gave the infielder $300 million over 10 years. That price, general manager Matt Klentak said, “exceeded our valuation, and sometimes you have to be willing to walk away.”

Scott Boras, Harper’s agent, is set on getting his client a deal bigger than Machado’s. The Phillies are well aware what the public perception will be if they end the offseason without either free agent, and they will be much more reluctant to walk away this time.

The Phillies’ confidence is increased by a market for Harper that appears to be thinning. Their biggest challenger could be San Francisco, but the Giants seem leery of a long-term deal. A return to Washington is unlikely, as the Nationals “have no plans” to sign Harper to a deal comparable to the one Machado scored, MLB.com reported Wednesday.

The Padres had been in on Harper, but their deal with Machado likely takes them out of the race. The White Sox said a $300 million contract for Machado “wasn’t feasible to us,” and they are not expected to be motivated to spend on Harper. The Phillies, two days after losing out on Machado, appeared Thursday to be in the driver’s seat to land the six-time All-Star.

Since 2015, Harper ranks in the top 10 among all major leaguers in on-base percentage, slugging percentage, home runs, and walks. Harper fits the profile that manager Gabe Kapler would love for his lineup. He is one of the game’s best power hitters, but he also has the approach needed to run up pitch counts, and he is not against working a walk.

He would provide the Phillies with star power and a needed lefthanded threat in their lineup. Plus, his track record at Citizens Bank Park makes it tempting to imagine what he could do with a full slate of home games in South Philly. Harper’s 14 homers at Citizens Bank Park are tied with three others for first among active visiting players in the history of the hitter-friendly ballpark. His .930 OPS is the sixth highest all-time among visitors.

Perhaps most importantly, Harper is just 26 years old. If he arrives, he would instantly join Pete Rose, Jim Thome, and Cliff Lee as the biggest free agents to sign with the Phillies. But those three were much older when they came to Philadelphia. Rose was 37 when he signed in December 1978. Thome was 32 in December 2002, and Lee was 32 in December 2010. The free agency of Harper and Machado, because of their age and talent, was nearly unprecedented.

Klentak noted earlier this spring that the Phillies were not bored as they waited for Machado and Harper to make their decisions. The general manager upgraded his lineup by trading for catcher J.T. Realmuto and shortstop Jean Segura and signing outfielder Andrew McCutchen. He bolstered the bullpen by signing David Robertson.

The Phillies reported to spring training as a much-improved team after last season’s collapse. But, so did the Nationals, Braves, and Mets. The National League East will present a much stiffer test this season.

The Phillies have labeled their offseason a success, but this winter stands to be judged on their ability to land a superstar. They failed to corral the first one, but their confidence remains high that they will not have to walk away from Harper.