With Madison's foreign policy subject to rising criticism from Republicans and Federalists alike, in March 1811 he replaced Secretary of State Robert Smith with Monroe. Both critics and friends of the administration welcomed the appointment of Monroe, an experienced diplomat, for Smith was widely regarded as incompetent. In bringing Monroe into the cabinet, Madison had decided to take a firmer stand with the European belligerents by refusing to settle minor issues unless major concerns were first resolved. As Monroe explained to John Taylor of Caroline, the time had come for the nation to "cease dealing in the small way of embargoes, non-intercourse, and non-importation" and prepare to defend its rights by force. Since neither the French minister nor his British counterpart had authority to make concessions, Monroe's efforts to press them for alterations in policy proved fruitless.
During August 1811 the president and Monroe met while in Virginia and agreed that unless the 1807 orders-in-council were repealed, the only recourse would be to declare war. When Congress met, Monroe worked closely with Speaker Henry Clay and John C. Calhoun, chairman of the House Committee on Foreign Affairs. Their cooperation, as well as the support of younger War Hawks, enabled Madison to secure the approval of defense measures. Monroe, in fact, helped Calhoun's committee draft a response to Madison's war message of 1 June 1812. The House responded promptly, but not until 18 June did the Senate concur.
Monroe preferred a field command during the war rather than the relative inactivity of the State Department, but this proved impossible, since it would have meant placing him over officers who had held higher ranks during the Revolution. When Secretary of War William Eustis, overwhelmed by the increased administrative burden, resigned late in 1812, Madison had to abandon his plan of appointing Monroe after it was learned that confirmation would encounter opposition from northern Republicans and Federalists critical of continued Virginia domination of the national government. To mollify his critics, Madison turned to John Armstrong, Robert Livingston's brother-in-law.
From the outset friction was evident between the two secretaries, for Armstrong felt that Monroe had deprived Livingston of the proper credit due for the Louisiana Purchase. Armstrong vigorously opposed the recommendation made by Monroe and others that the defenses of the capital and Chesapeake Bay area needed strengthening against the possibility of an invasion. Preferring to direct the affairs of his department from the field with the northern army, Armstrong continued to minimize the threat even after it was learned in the spring of 1814 that the British were amassing a large force in the West Indies.
On 2 July, disregarding Armstrong's objections, Madison created a new military district for the bay area under the command of General William Winder, whose preparations were persistently obstructed by the secretary of war. Thus, when a large British force appeared in the bay, no arrangements had been made for reconnaissance. It was Monroe, riding out with a troop of volunteer cavalry, who brought the first reports of the British movement.
Armstrong was blamed for the resultant fiasco at Bladensburg—where the president, Monroe, and Armstrong were all on the field—and the subsequent British occupation of Washington and burning of the public buildings in August 1814. Armstrong's resignation and his replacement by Monroe, who continued as acting secretary of state, were greeted enthusiastically by the citizens of Washington and the military.
Working long hours—frequently sleeping in his office—Monroe brought order into the confused state of affairs in the War Department. His service came too late to affect the outcome of the war, for the Treaty of Ghent arrived in February 1815. As secretary of state, Monroe had drafted the original instructions for the peace commissioners as well as the later modification authorizing them to abandon the American demands on impressment and neutral rights. After relinquishing the War Department in March 1815, Monroe left for a much needed rest in Virginia. Not until six months later was he well enough to return to the capital and begin the negotiations that culminated in the Rush-Bagot agreement to demilitarize the Great Lakes.
With the war over, public interest promptly focused on the coming presidential election. It was generally assumed that Monroe, because of his close association with Jefferson and Madison and long service to the nation, would be the Republican nominee. However, the nomination was by no means assured, for many northern politicians were weary of Virginia domination. New Yorkers were the most outspoken, feeling that they had too long been relegated to the second place on the ticket. Without a northern candidate of national stature, they turned to the secretary of the treasury, William H. Crawford. A former senator from Georgia, Crawford owed his prominence to the fact that his easygoing, jovial manner had made him immensely well liked by congressmen; since the nomination was in the hands of a congressional caucus, his personal popularity was a major asset. He also had the backing of Jefferson's secretary of the treasury, Albert Gallatin, to whose influence Crawford owed his elevation to the Treasury.
Monroe and his congressional supporters were sufficiently worried by Crawford's candidacy that they considered boycotting the congressional caucus in favor of a state nomination. Madison, following Jefferson's example, was outwardly neutral, but his preference for Monroe was well known. The columns of the National Intelligencer , the semi-official administration paper, were full of pro-Monroe items. Crawford, only forty-four, was reluctant to challenge his senior colleague but did not publicly withdraw his name. Consequently, when the caucus met in March 1816, Monroe was nominated by the disappointingly small margin of sixty-five to fifty-four. In effect the caucus was the real election, since the Federalists were so weakened by their opposition to the war that they mustered only minimal support for Rufus King, who received 34 electoral votes to the 183 cast for Monroe.
The disparity in the electoral count marked the end of the first two-party system, a development welcomed by leaders of Monroe's generation in both parties. They had long regarded party conflict as a divisive element tending to destroy republican institutions. They cherished the ideal expressed by Washington in his farewell address of a nation without parties, governed by men chosen on their merits. Shortly after his election Monroe expressed his commitment to this goal when he observed that the "Chief Magistrate of the Country ought not to be the head of a party, but of the nation itself." However, he did not fall in with Andrew Jackson's suggestion that the process of party amalgamation be facilitated by appointing Federalists to high office. Free government, Monroe told Jackson, must still depend on its "decided friends, who stood firm in the day of trial."