The Wells Fargo Championship appeared to be headed for a playoff on Sunday until Brian Harman seized the title with a birdie-birdie finish in Wilmington, N.C.
Harman finished 72 holes at 10-under 278.
The top-ranked Johnson was denied an opportunity to win his fourth consecutive title on the PGA Tour because of Harman's heroics. Playing for the first time since a slip down some stairs resulted in a back injury that knocked Johnson out of the Masters last month, he posted back-to-back 67s after barely making the cut on Friday.
On the decisive par-5 18th hole, Harman's second shot sailed over the green near a corporate tent. After Harman got relief, his chip barely landed on the edge of the green. From there, however, he made the winning putt.
"I didn't hit a great chip. It didn't turn out very good," Harman said, "but I guess it went where it was supposed to."
Harman won for the second time in his career. His only other victory was in the 2014 John Deere Classic.
The victory almost didn't come to pass after Harman made a three-putt bogey on No. 15.
"It's surreal," Harman said. "I three-putted that 15th hole, knew it was going to be tough to birdie those last couple. But I stuck to my game plan and just did it. Did the best I could."
Johnson made a 15-foot birdie putt on 18 that gave him a share of the lead until Harman came along. Then Johnson waited in the clubhouse with Perez for a possible playoff.
"I didn't really know what to expect this week because I didn't really get to practice leading into this tournament," Johnson said. "Not much has changed. The first couple days I didn't play that great, but really played nicely on Saturday and Sunday, and so I'm happy with where the game is going into next week."
Perez recovered after he stumbled with a double bogey on No. 14 with birdies on Nos. 16 and 18 to finish with a 68.
Jon Rahm of Spain, who shared the lead on the back nine for a time, needed an eagle on the final hole, but his approach shot went over the green and his chip wasn't close. He finished alone in fourth at 280 after a final-round 71.
Patrick Reed, the 54-hole leader, was doomed by four bogeys in a six-hole stretch on the back nine. He shot 40 on the back nine and wound up tied for 12th at 283 following a 75.
Phil Mickelson tied for 18th at 285 after a 72 on the final 18 holes.