By Karl Plume

CHICAGO (Reuters) - U.S. agricultural commodities trader Archer Daniels Midland Co <ADM.N> has sold its 19.9 percent stake in GrainCorp Ltd <GNC.AX> to underwriters UBS just three years after a failed bid to wholly acquire the Australian grain handler, ADM said on Thursday.

The sale to the Swiss bank was valued at A$387 million ($286.92 million), or A$8.53 a share, ADM said.

ADM's A$2.8 billion bid to buy Australia's largest listed grain handler was blocked by government regulators in 2013 near the peak of a grain market boom.

Commodities prices have since tumbled and ADM and rival agribusinesses are focusing increasingly on higher-margin businesses such as natural food ingredients and specialty commodities to boost slumping returns.

"This transaction will allow us to further reduce our invested capital, and it will provide cash that we can redeploy to higher-return investments," ADM Chief Executive Officer Juan Luciano said in a statement.

ADM had been shopping its GrainCorp stake this year, but was unable to find a buyer for the entire stake and canceled the sale process in July 2016, sources said.

ADM shares were up about 2.5 percent on Thursday at $44.31, up nearly 21 percent since the beginning of 2016. GrainCorp shares drifted lower to A$8.71 in early trading on the Australian Stock Exchange on Friday, up less than 1 percent on the year.

(Editing by Dan Grebler and Chris Reese)