By 1844, Stewart had left the Whigs for the
Democratic Party. In 1845, he was a member of the committee Baltimore's Democrats formed to arrange civic honors to commemorate the death of Andrew Jackson. In May 1846, Stewart took part in public meetings intended to demonstrate popular support for U.S. participation in the
Mexican–American War. In June 1846, Stewart was elected second vice president of the Baltimore City Democratic Convention. In August of that year he was a vice president of the Baltimore Democratic Party meeting that passed resolutions commending Vice President
George M. Dallas for voting to repeal the
Tariff of 1842 and requesting that a delegation be permitted to call on him when he next visited Baltimore so they could express their appreciation in person. In early 1848, Stewart was one of the managers of a Baltimore Democratic Party ball held to celebrate American success in the war with Mexico.
In mid to late 1848, he was one of the prominent Democrats who organized the Baltimore campaign for the presidential ticket of
Lewis Cass and
William O. Butler. Stewart was also active in civic causes; In May 1848, he was one of the leaders of a mass public meeting held to plan and implement relief efforts for victims of a recent fire that had destroyed 60 Baltimore homes and several commercial buildings. In August 1848, was named a vice president of Baltimore's Friends of Ireland, an organization created to provide aid to the Irish people during the
famine of 1845 to 1852. In June and July 1849, Stewart was one of the Baltimore Democrats who took part in organizing and conducting honors to commemorate the death of former president
James K. Polk. In December 1849, Stewart was appointed to the United States Senate to fill the vacancy caused by the resignation of
Reverdy Johnson. Stewart then resumed practicing law in Baltimore. In January 1850, the city council appointed Stewart as one of Baltimore's members of the
Baltimore and Ohio Railroad board of directors. In mid-1850, Stewart publicly supported the
Compromise of 1850 and took part in Pro-Union conventions of delegates from the
Whig and
Democratic parties that sought to prevent the secession of slaveholding states through passage of the compromise measures. In September 1850, Stewart was a featured speaker at the Baltimore Democratic Party rally which opened that year's fall campaign. Stewart was a delegate to the Maryland Constitutional Convention of 1850–1851. In February 1851, he was among several prominent Baltimore residents who publicly petitioned Congress for regular steamship routes between the U.S. and
Liberia as part of the colonization movement. In September 1851, Stewart was a delegate to that year's state Democratic convention, which was held to nominate candidates for statewide offices in that November's elections, and he called the meeting to order as its temporary chairman. Stewart was a prominent speaker at Democratic rallies in Baltimore during October 1851, which were held prior to the elections scheduled for that November. During that month, Stewart was also named a manager of the mayoral committee created to organize a public reception for
Hungarian revolutionary
Lajos Kossuth, who was then visiting the United States. In December 1851, Stewart was one of the managers of a ball sponsored by the city Democratic committee which celebrated the new year and also honored Kossuth. ==Later career==