Nadal showed few signs of rustiness in his 6-1, 7-6 (4) opening win at home. He cruised in the first set and recovered in the second after twice losing his serve following a rain interruption.
"My preparation has not existed. You cannot expect great things at the beginning,'' he said. "In general I have done a good match. First set was very good. The second set I don't consider it a bad set, but as I am saying, when you have been a long time without competing, it's normal that you have up-and-downs in a match because you have to recover your routine."
The match lasted nearly two hours, but it was fast enough to allow Nadal to watch Real Madrid's Champions League match later Wednesday night in the Spanish capital. Tournament organizers said Nadal asked to play in the afternoon so his match would not coincide with Madrid's semifinal game against Manchester City.
"Yeah, going to be a spectacular atmosphere there. I would love to arrive a little bit before, but I am answering the questions enough well and I think long enough, to be fair with you," Nadal said, smiling, at the postmatch news conference.
Nadal is a Madrid fan and on Saturday gave the ceremonial kickoff at the Santiago Bernabéu Stadium before the team clinched the Spanish league title with a win against Espanyol.
The fourth-ranked Nadal had been out for nearly 45 days after a rib stress fracture halted his great start to the season, highlighted by winning his record 21st Grand Slam title with victory at the Australian Open.
"Coming from injury I always need to play many matches to regain my best form," Nadal said. "Winning is very important to give me confidence."
Nadal was cruising before getting injured in the semifinals at Indian Wells, where he lost the final to Taylor Fritz for his first defeat of the season. Nadal missed tournaments in Miami, Monte Carlo and Barcelona.
The third-seeded Nadal had been downplaying expectations of winning his sixth Madrid Open title, and first since 2017.
Nadal, 35, looked sharp in the first set, though, breaking serve twice against the 32nd-ranked Kecmanovic. He struggled more after the match was interrupted for about half an hour with Kecmanovic leading 1-0 in the second set as the center-court roof had to be closed. Nadal was broken twice, including while serving for the match at 6-5, but eventually prevailed in the tiebreaker by converting his first match point with an ace.
If he wins in Madrid, Nadal will move level with Djokovic on a record 37 titles in Masters 1000 tournaments.
The third-ranked Zverev is seeking his first title of the season. He lost to Stefanos Tsitsipas in the Monte Carlo semifinals. Zverev also won in Madrid in 2018.
"I thought I played very well. I just lost focus in the first set,'' Zverev said. "Marin is a difficult opponent, especially with the altitude here, so I am happy with this match.''
Marc Lopez retired after losing his doubles match with Alcaraz 6-3, 3-6, 10-7 to Wesley Koolhof and Neal Skupski. Lopez, who won the Olympic doubles gold medal with Nadal in 2016, is joining the coaching staff of the Spanish great.
The Associated Press contributed to this report.