The German shot a 1-over-par 72 at Carnoustie to finish at 5-under 279. Pavin, captain of the American Ryder Cup team, closed with a 70.
"I have always wanted to win the British Open," said the 52-year-old Langer, who won the Masters in Augusta, Ga., in 1985 and 1993. "I didn't. Now this is the next-best thing."
Langer, who had a birdie on the 15th hole, has 11 victories on the Champions Tour.
"This victory ranks very high and it's pretty close to my two U.S. Masters titles and some of my Ryder Cup stuff," he said.
Pavin finished three strokes ahead of Americans Fred Funk (72), Jay Don Blake (72) and Russ Cochran (72) and Australian Peter Senior (68).
"It's tough when you almost win," the 50-year-old Pavin said. "Bernhard didn't play his best golf today but he did what he needed to do and that's what it's all about."
Tom Watson (74) finished tied for 24th place at 290. The 60-year-old American said he plans to return next year to play in both the British Open and Senior British Open, as he did this year.
"Sometime I can see in the future when my level of play might not be good enough to come over here and play," Watson said. "That's when you have to make a decision, but I am not quite there yet."