Last season's Asian Champions League winners were trailing with 20 minutes to play due to Kim Byung Suk's opener for Yamagata in first-half stoppage time.

Despite a bright start in which Brazilian midfielder Lucas had a shot punched onto the bar by Yamagata goalkeeper Kenta Shimizu, Gamba went behind on the stroke of half-time when Leonardo headed a corner down in front of Kim who steered the ball home off his left boot.

But Gamba continued to dominate in the second half, and they got their reward in the 71st minute when Endo coolly chipped the ball over Shimizu after playing a smart one-two on the edge of the box with substitute Hayato Sasaki.

Seven minutes later former Yamagata player Leandro intercepted a clearance and fired it home on the volley from long range.

"If you lose your concentration, you concede a goal," said Gamba manager Akira Nishino.

"But with this win, we can go to Indonesia (for an ACL match with Sriwijaya on Wednesday) knowing we're in a comfortable position."

The win puts Gamba in second place on 10 points, two behind leaders Kashima Antlers who have played a game less. Yamagata are in third, also on 10 points but behind on goal difference.