American Ward, 32, won the battle of the unbeaten fighters by 114-113 on all three ringside scorecards in Las Vegas.
Ward landed some good punches but withstood pressure from Kovalev, 33, who was unhappy with the US judges.
"I agree they support their boxer but honestly, this is sport. Don't make it like politics," he said.
Asked whether he would face Ward again, Kovalev replied: "Sure - and I'll kick his ass."
But Ward felt he was worthy of his 31st professional victory.
"In a tight fight, he's going to feel like he got robbed. I'd have been been disappointed. But we got the belts tonight," he said.
"That was the first time in my career I got dropped. I'm pleased with the  way I responded."
Kovalev's promoter Kathy Duva said she would use the rematch clause in the contract for a second fight.
"He won the first six rounds so I don't know how he could lose a decision,'' she said.
The clash between the skilful Ward and hard-hitting Kovalev was billed as the fight of the year, and lived up to expectations.
Ward had said he could finish the former super-middleweight champion early, but was left on the canvas in the second round by a stinging right-hander.
He eased his way back into the contest and landed a good left in the seventh round which jolted Kovalev.
Ward won all of the last six rounds on two scorecards, and five of six on a third , to inflict his opponent's first defeat in 32 fights.
"It was a fight of my life,'' said Kovalev. "I am disappointed in the judges' decision. He got maybe a few rounds, I agree with that. I kept control. I lost maybe three rounds the whole fight.''
The judges appeared to favour Ward's counter-punching against the aggressive style of Kovalev.
"We were a little careless with that knockdown in the second round, but we landed the cleaner punches,'' said Ward's trainer Virgil Hunter.
On the undercard, two-time Olympic gold medallist Claressa Shields made her professional debut, winning a decision over Franchon Crews in a four-round super middleweight fight.
Andre Ward survived a second-round knockdown to beat Sergey Kovalev on points and claim the Russian's IBF, WBA and WBO light-heavyweight titles.