In 1918, Nielsen served in the United States Army until Armistice and attained the rank of major. He represented the United States at the 1919 Paris Peace Conference, and was the primary American representative in a commission re-examining Belgian treaty obligations of 1839. Nielsen served on the committee that decided the sovereignty of the Spitsbergen archipelago. On June 23, 1920, President Wilson appointed Nielsen as the Solicitor of the State Department, the department's chief legal officer. Nielsen resigned from that position in 1922, and later that year, President Harding nominated him as the American representative for the British-American Claims Commission. Nielsen later served as the American commissioner of the Mexican Claims Commission, which existed from 1924 to 1937 to settle disputes between the two nations. In 1931, he resigned from that post "in disgust" at the actions of some of the Mexican and Panamanian delegates.