Hayes's presidency was a quiescent period in American foreign relations. The State Department employed only fifty-one people in Washington, from assistant secretaries to clerks. The armed forces were maintained on a similar scale. Congress in 1877 imposed a limit of twenty-five thousand officers and men on the army and seventy-five hundred on the navy. The largely wooden fleet would have been ill matched against some Latin American nations. The country felt so secure behind its ocean frontiers that Hayes used the secretaryship of the navy for his only fully political cabinet appointment: Richard W. Thompson of Indiana, derided as "the ancient mariner of the Wabash," although a decent executive, knew nothing of ships or strategy. Secretary of State Evarts devoted his energies principally to upgrading the quality of the foreign service and improving its efficiency in handling routine matters. He required consuls to study the language and history of their host countries. He also instructed them to gather detailed economic statistics, which were then made available monthly to American merchants and manufacturers in hopes of stimulating increased exports of American products to Europe, Latin America, and Asia.
Only three diplomatic issues of consequence arose in the late 1870s. The most serious dispute was with Mexico. Shortly before Hayes became president, Porfirio Díaz seized power in Mexico City but was unable immediately to extend his control throughout the country. Marauding Indians took advantage of the situation to conduct raids into western Texas and southeastern New Mexico. As a consequence, Evarts and Hayes refused to recognize the Díaz government, while Secretary of War George McCrary authorized army units in Texas to pursue bandits across the border. Unfortunately, no action was better calculated to awaken Mexican fears of further territorial aggrandizement by the United States. Not until April 1878 did Evarts reverse himself and recognize Díaz. Even then, it took another year for Díaz to suppress the border raids and two years for McCrary to withdraw his offensive order. Thereafter, a mutual interest in the economic development of Mexico gradually drew the two countries closer together.
A similar truculence characterized the American response to Ferdinand de Lesseps' French Panama Canal Company. This time Hayes himself set the tone, telling Congress in a special message of March 1880 that "the policy of this country is a canal under American control." He explained that the canal would be "virtually a part of the coastline of the United States," which was emerging as a two-ocean power. Yet Hayes simultaneously opposed any attempt by the American government to build an isthmian waterway, preferring that it be strictly a private undertaking. Because the French government also declined to involve itself directly, that is what de Lesseps' project became. In need of vast sums of capital, the French promoter then began to sell stock to American investors. To this end he hired Navy Secretary Thompson as the chairman of the American Committee of his Panama Canal Company. A chagrined Hayes was forced to dismiss his wayward cabinet adviser. The staunch nationalism Hayes displayed in this episode was at once a logical extension of past American continental expansion and a forerunner of the more active involvement in world affairs that future Republican presidents would pursue.
Hayes devoted many of his official addresses to the need to overcome sectional and racial prejudices. The problem did not extend just to the South. In 1876, in response to growing agitation in California and Oregon, both major party platforms demanded strict limitations on Chinese immigration. Chinese laborers had built most of the railroads on the west coast and were currently employed in diking and draining the Sacramento delta to create some of California's richest farmland, but that did not endear them to workers of European descent. In 1879, Congress passed a law setting a limit of fifteen Chinese immigrants on any single ship, thus directly contravening the terms of the Burlingame Treaty of 1868, which permitted unrestricted immigration. As he did on other occasions when Congress overstepped its bounds and intruded upon presidential authority; Hayes vetoed the bill. Evarts then sent a commission to China to negotiate both a commercial treaty and an agreement under which the Chinese regulated the immigration of laborers to the United States according to American wishes. Both compacts were ratified shortly before Hayes left office. The effect, of course, was to uphold the sanctity of treaties rather than to protect the equality of peoples.