In 1874, Smalls was elected to the United States House of Representatives, where he served two terms from 1875 to 1879.
From 1882 to 1883, he represented South Carolina's 5th congressional district in the House.
The state legislature gerrymandered to change the district boundaries, including Beaufort and other heavily black, coastal areas in South Carolina's 7th congressional district, giving the others substantial white majorities.
Smalls was elected from the 7th district and served from 1884 to 1887.
He was a member of the 44th, 45th, 47th, 48th, 49th U.S. Congresses.

In 1875, he opposed the transfer of troops out of the South, fearing the effect of such a move on the safety of blacks in the South.
During consideration of a bill to reduce and restructure the United States Army, Smalls introduced an amendment that "Hereafter in the enlistment of men in the Army...no distinction whatsoever shall be made on account of race or color."
However, the amendment was not considered by Congress.
He was the last Republican elected from the 5th district until 2010 when Mick Mulvaney took office.
He was the second-longest serving African-American member of Congress (behind his contemporary Joseph Rainey) until the mid-20th century.

After the Compromise of 1877, the U.S. government withdrew its remaining forces from South Carolina and other Southern states.
Conservative Southern Bourbon Democrats, who called themselves the Redeemers, had resorted to violence and election fraud to regain control of the state legislature.
As part of wide-ranging white efforts to reduce African-American political power, Smalls was charged and convicted of taking a bribe five years earlier in connection with the awarding of a printing contract.
He was pardoned as part of an agreement by which charges were also dropped against Democrats accused of election fraud.

The scandal took a political toll, and he was defeated by Democrat George D. Tillman in 1878, and again, narrowly, in 1880.
He successfully contested the 1880 result and regained the seat in 1882.
In 1884, he was elected to fill a seat in a different district.
He was nominated for Senate but defeated by Wade Hampton in 1886.
During this period in Congress he supported racial integration legislation, supported a pension for the widow of his former Major General, David Hunter, and advised South Carolina blacks to refrain from emigrating to the North and Midwest or to Liberia.

In 1890, he was appointed by President Benjamin Harrison as collector of the Port of Beaufort, which he held until 1913 except during Democrat Grover Cleveland's second term.
Smalls was active into the twentieth century.
He was a delegate to the 1895 South Carolina constitutional convention.
Together with five other black politicians, he strongly opposed white Democratic efforts that year to disfranchise black citizens.
They wrote an article for the New York World to publicize the issues, but the state constitution was ratified.
It and similar constitutions across the South for some time passed challenges that reached the US Supreme Court, resulting in the exclusion of African Americans from politics across the South and crippling of the Republican Party in the region.

In the late 1890s, he began to suffer from diabetes.
He turned down an offer of a colonelcy of a black regiment in the Spanish-American War and to the post of minister to Liberia.
In 1874, Smalls was elected to the United States House of Representatives, where he served two terms from 1875 to 1879. From 1882 to 1883, he represented South Carolina's 5th congressional district in the House. The state legislature gerrymandered to change the district boundaries, including Beaufort and other heavily black, coastal areas in South Carolina's 7th congressional district, giving the others substantial white majorities. Smalls was elected from the 7th district and served from 1884 to 1887. He was a member of the 44th, 45th, 47th, 48th, 49th U.S. Congresses.
In 1875, he opposed the transfer of troops out of the South, fearing the effect of such a move on the safety of blacks in the South. During consideration of a bill to reduce and restructure the United States Army, Smalls introduced an amendment that "Hereafter in the enlistment of men in the Army...no distinction whatsoever shall be made on account of race or color." However, the amendment was not considered by Congress. He was the last Republican elected from the 5th district until 2010 when Mick Mulvaney took office. He was the second-longest serving African-American member of Congress (behind his contemporary Joseph Rainey) until the mid-20th century.
After the Compromise of 1877, the U.S. government withdrew its remaining forces from South Carolina and other Southern states. Conservative Southern Bourbon Democrats, who called themselves the Redeemers, had resorted to violence and election fraud to regain control of the state legislature. As part of wide-ranging white efforts to reduce African-American political power, Smalls was charged and convicted of taking a bribe five years earlier in connection with the awarding of a printing contract. He was pardoned as part of an agreement by which charges were also dropped against Democrats accused of election fraud.
The scandal took a political toll, and he was defeated by Democrat George D. Tillman in 1878, and again, narrowly, in 1880. He successfully contested the 1880 result and regained the seat in 1882. In 1884, he was elected to fill a seat in a different district. He was nominated for Senate but defeated by Wade Hampton in 1886. During this period in Congress he supported racial integration legislation, supported a pension for the widow of his former Major General, David Hunter, and advised South Carolina blacks to refrain from emigrating to the North and Midwest or to Liberia.
In 1890, he was appointed by President Benjamin Harrison as collector of the Port of Beaufort, which he held until 1913 except during Democrat Grover Cleveland's second term. Smalls was active into the twentieth century. He was a delegate to the 1895 South Carolina constitutional convention. Together with five other black politicians, he strongly opposed white Democratic efforts that year to disfranchise black citizens. They wrote an article for the New York World to publicize the issues, but the state constitution was ratified. It and similar constitutions across the South for some time passed challenges that reached the US Supreme Court, resulting in the exclusion of African Americans from politics across the South and crippling of the Republican Party in the region.
In the late 1890s, he began to suffer from diabetes. He turned down an offer of a colonelcy of a black regiment in the Spanish-American War and to the post of minister to Liberia.
Robert Smalls