Gwin accepted Fremont's election as being a given and argued that, as a Southerner, he could help achieve statehood in a Congress divided along sectional lines. In the end Fremont and Gwin were selected. They drew straws to see who would take the short term of two years and who the long term of six years. Gwin won the long term. Fremont and Gwin travelled together to Washington in January 1850. During the debates that led up to statehood for California Gwin supported the Clay compromise but remained out of the lime light and worked on reestablishing his personal relations with the national leadership of the Democratic Party. During his first term he worked on a number of important bills related to California and managed to get most of them passed into law. His successes in Washington were popular in California and he managed to get John Weller,one of his own supporters, selected to fill the Fremont Senate seat in 1852.
On his return to Washington he was chosen to be the Chairman of the Senate Committee on Naval Affairs. He used his position to pass legislation providing for a naval shipyard at Mare Island, coastal fortifications, and a series of lighthouses along the coast. He also urged unsuccessfully the construction of a transcontinental railroad that would tie California to the rest of the Union. His original proposal would have seen the line constructed through the South and, as a result, it ran into strong opposition from Northern Senators. Later he chaired a select committee of the Senate to consider the transcontinental railroad and actually got a compromise bill passed by the Senate. It was, however, too late in the session for House action and nothing came of it. During this period Gwin appears to have been shifting his ambitions from the state level to the national level and he did not pay adequate attention to local events in California.
California Governor John Bigler sought Gwin's assistance in obtaining the Ambassadorship to Chile. Gwin ignored him and the Governor shifted his support from Gwin's wing of the party. This development led to David Broderick being named Chairman of the California Democratic Party. The antagonism that existed between Broderick and Gwin badly split the Democratic Party and Gwin lost his firm control of it. An argument that erupted over his alleged mismanagement of federal patronage resulted in Gwin and Congressman Joseph McCorkle facing each other in a duel with rifles at thirty yards. Shots were fired by both men but neither was hit. (A donkey some distance off was, however, shot dead.) All of this introduced a period of exceptional turmoil in California's political scene. Bribery, physical intimidation, and non-stop political maneuvering were the order of the day.
Eventually Gwin and his supporters strengthened their hand and in the fall of 1854 Gwin returned to San Francisco with his family to take control of the local scene himself. The Broderick faction of the party was obviously in the minority but it was able to block the selection of any candidate to fill Gwin's Senate seat. As a result California only sent one senator to Washington in 1855. The weakness of the Whig Party and the paralysis of the Democratic Party permitted the Know Nothing Party to elect a number of candidates in California in 1854. A public murder and the ineffectiveness of the Know Nothing officials then in office in San Francisco and Sacramento stimulated the resurgence of vigilantism in San Francisco in 1856. Because the Broderick wing of the Democratic Party included a number of toughs the Vigilantes forced many of them to leave California. In the election of 1856 the Broderick and Gwin factions of the Democratic Party cooperated against the Know Nothings and both Gwin and Broderick were elected Senators.
Gwin and Broderick travelled to Washington together arriving in New York on February 13, 1857. Gwin once again quickly reestablished himself in Congress. James Buchanan, a Democrat, was President and was Gwin's long time personal friend. Gwin was in a position to once again exercise control over a strengthened Democratic Party in California. Even though the newly formed Republican Party carried several important urban contests, Gwin's wing of the Democratic Party did very well in the California elections of 1859. Following the election of Abraham Lincoln in 1860 Gwin played a minor role as a go-between in secret discussions between Lincoln's new Secretary of State, William Seward, and various Southern leaders to see if some sort of compromise could be worked out that would avoid a permanent dissolution of the Union. These discussions failed.
Following Lincoln's inauguration but before hostilities broke out between the states, Gwin toured the South and then returned to California. In California the Chivalry spoke on the South's behalf and suffered a backlash at the polls in the elections of 1861. Republicans swept into power at the local level. Before the Republican victory at the polls Gwin considered that it might be possible to establish a Republic of the Pacific centered on California that would remain aloof from the Civil War. Seeing that there was little that he could do in California Gwin returned east to New York where his wife had moved. He was arrested by federal agents on arrival in New York City, but President Lincoln intervened on his behalf and he was released. He sent his wife and one of his daughters to Europe and he returned to his plantation in Mississippi. The plantation was destroyed in the war and Gwin, a daughter, and son fled to Paris. (His son had been a Confederate soldier but was mustered out just before their departure from Mississippi.)
In 1864 the Civil War was going against the South and Gwin met with Emperor Napoleon III in Paris. He knew that the French were interested in establishing Maximilian in Mexico and offered his services in protecting Mexico's northern border by settling Sonora with southerners who would not want to remain in a country dominated by the North. Napoleon was receptive but Maximilian was opposed to the plan. Maximilian feared that Gwin and his southerners would take Sonora for themselves. The plan was never implemented. Following the final defeat of the South in 1865 Gwin returned to New Orleans, turned himself in to General Phillip Sheridan and requested permission to rejoin his family who were returning from Europe. Sheridan gave his permission but it was countermanded by President Johnson. Gwin was imprisoned in Mississippi but eventually released by order of President Johnson. (Both of Gwin's imprisonments appear to have been ordered by Seward who was concerned that Gwin would expose his own attempt to compromise with the South prior to the outbreak of hostilities.)
Following his release, Gwin returned to San Francisco with his family, prospered through investment in agriculture and mining, and lived a quiet life. He died in New York City on September 3, 1885 and is buried in Oakland, California.