LONDON — Goldman Sachs said on Friday that it had hired José Manuel Barroso, the former European Commission president and former prime minister of Portugal, as an adviser and nonexecutive chairman of its Goldman Sachs International arm.

Mr. Barroso was president of the European Commission from 2004 to 2014 and the prime minister of Portugal from 2002 to 2004.

“José Manuel brings immense insights and experience to Goldman Sachs, including a deep understanding of Europe,” Michael Sherwood and Richard J. Gnodde, the co-chief executives of Goldman Sachs International, said in a news release. “We look forward to working with him as we continue to help our clients navigate the challenging and uncertain economic and market environment.”

Mr. Barroso was first elected to Portugal’s Parliament in 1985 and served in a variety of positions, including state secretary for home affairs, state secretary for foreign affairs and cooperation and minister for foreign affairs.