TOKYO—Japanese Prime Minister Shinzo Abe said he would attend the opening ceremony of the Winter Olympics in South Korea, a move aimed at patching up ties between neighbors after they clashed over wartime history.

Mr. Abe held off on making a decision until just two weeks before the Games open in Pyeongchang on Feb. 9. Japanese diplomats had expressed deep displeasure with South Korea’s criticism of a 2015 agreement between the two countries over Korean women forced into sexual service for Japanese soldiers in World War II.

...