South Korean President Lee Myung-bak, front right, visits a set of remote islands called Dokdo in Korean and Takeshima in Japanese, east of Seoul on Friday. (YONHAP/REUTERS)

South Korean President Lee Myung-bak on Friday visited a craggy group of islets that are claimed by Japan, prompting Tokyo to summon its ambassador from Seoul and inflaming already testy relations between the East Asian neighbors.

Lee’s surprise trip to the disputed territory in the Sea of Japan, also known as the East Sea, was the first by a South Korean president, and analysts in Seoul and Tokyo said it appeared that Lee was trying to boost his flagging popularity at home.

But Japanese Foreign Minister Koichiro Gemba warned that the visit would “definitely have a large impact” on bilateral relations between the key trade partners. In protest, Japan asked its ambassador to South Korea to temporarily return home and lodged a complaint with the South Korean envoy in Tokyo, Shin Kak-soo.

The trip was “very regrettable,” said Masaru Sato, a spokesman for Japan’s Foreign Ministry, adding that “it contradicts Japan’s position” on the islets.

Lee’s trip marked an abrupt and curious escalation in the way South Korea has handled the long-brewing territorial dispute, and the response in Seoul was mixed. The president, with six months remaining in his single five-year term, has dealt lately with sagging approval ratings — driven lower by a recent corruption scandal involving his brother — and his party has tried to distance itself from Lee ahead of December elections.

An opposition party spokesman in Seoul criticized Lee for a “publicity stunt” intended to deflect criticism of his failings, according to the Yonhap news agency.

The islets, known in South Korea as Dokdo and in Japan as Takeshima, have been a focal point of tensions between the countries for decades. The rocks, which are inhabited by just a handful of residents and guarded by a small South Korean police detachment, sit halfway between the two countries in an area known for its rich fishing. They are controlled by South Korea, but Japan makes frequent claims to the territory, most recently in a Defense Ministry white paper released last week.

Lee’s trip to Dokdo could further stall a controversial military pact that has been negotiated between the two countries but put on hold because of domestic resistance in South Korea.

Many South Koreans still harbor deep bitterness toward Japan, a legacy of Japan’s repressive 35-year colonization of the peninsula. Seoul frequently presses Japan to apologize for its occupation and use of Korean women as front-line sex slaves for Japanese soldiers during World War II.

South Korea will celebrate the 67th anniversary of its liberation from Japanese rule on Wednesday.