Japan Exchange Group Inc. (JPX) and Tokyo Commodity Exchange Inc. said Thursday the two institutions have agreed to merge in October to enhance their competitiveness against overseas rivals.

The merger is aimed at creating the country's first all-in-one exchange that can handle both stocks and commodity futures including metals and grain, as Japan has lagged behind a global trend of integrated bourses.

Japan Exchange Group, owner of the Tokyo and Osaka stock exchanges, will turn Tokyo Commodity Exchange into a wholly owned subsidiary after signing a final agreement in late June.

Japan Exchange Group said the merger "will be the best for the two companies."

A spokesperson for the Japan Exchange Group said the merger "will be the best for the two companies."

Some commodities handled at the Tokyo Commodity Exchange, such as gold, soybeans and rubber, will be traded at the Osaka Exchange, while energy-related commodities including crude oil will stay at the Tokyo Commodity Exchange for the time being.

Japan Exchange Group and the Tokyo Commodity Exchange signed a nondisclosure agreement in October last year and have been discussing terms of the merger since then.