All of the Japanese Ground Self-Defense Force members engaged in a U.N. peacekeeping mission in South Sudan have returned to Japan, marking the completion of their five-year operation in the conflict-torn country, the Self-Defense Forces said Saturday.

The withdrawal of the most recently deployed 350-member unit took place in stages based on the Japanese government's decision announced in March. With no SDF unit serving in active U.N. missions, Tokyo is now considering other ways to contribute to international peace-building efforts.

The unit was mainly composed of members of the GSDF's 9th Division headquartered in the city of Aomori. The last contingent of 40 troops arrived at Aomori Airport in northern Japan on Saturday.

The GSDF unit has drawn particular attention back home because the members were the first to have been assigned expanded roles under controversial security legislation that Japan put into force in March last year. But the unit ended up without performing the new roles during their stay that began from around December.

The SDF activities overseas have been restricted under Japan's war-renouncing Constitution, but Prime Minister Shinzo Abe's government has largely loosened the constraints through the legislation so the SDF can more actively contribute to ensuring peace and security.

In South Sudan, SDF members were given more leeway in the use of weapons, which enabled them to go to the rescue of U.N. staff and others under attack. Previously, the use of arms was strictly limited to self-defense purposes.

They were also tasked with playing a bigger part in protecting U.N. peacekeepers' camps.

Japan has deployed civil engineering corps to South Sudan since 2012 for the construction of roads and other infrastructure as part of the U.N. mission in South Sudan or UNMISS.

But the security situation has remained murky in the African country, which gained independence from Sudan in 2011, with fighting continuing from the end of 2013 between the South Sudan government and rebel forces.

A peace deal was signed in August 2015, but renewed fighting in Juba last July killed more than 270 people and led many to flee their homes.

The Japanese government has denied the security situation was the reason for the withdrawal, but speculation remains that continuing the deployment would have raised the risk of Japanese troops getting embroiled in overseas fighting for the first time since World War II.

The loss of lives during SDF missions would likely trigger a huge public outcry in Japan, where many people cherish the pacifism embedded in the post-World War II Constitution.

In announcing the pullout, the Japanese government explained that the deployment of the SDF civil engineering unit had become unprecedentedly long for a U.N. peacekeeping operation and hailed that the work over the past five years produced significant results.

According to the government, a total of about 3,900 people were sent for civil engineering work starting from January 2012 and engaged in maintenance of about 260 kilometers of road, preparation of building sites and other work in Juba.