Robert B. Morgan, a North Carolina Democrat who was a freshman U.S. senator when he cast crucial votes in favor of treaties that transferred control of the Panama Canal to the Panamanian government, a decision that brought a swift end to his Senate career but which he stood by all his life, died July 16 at his home in Buies Creek, N.C. He was 90.

The cause was complications from Alzheimer’s disease, said his former Senate chief of staff, Carroll Leggett.

Mr. Morgan practiced law and ascended the ranks of North Carolina politics before his election to the U.S. Senate in 1974. He served in the North Carolina state Senate, including a stint as president pro tempore, from 1955 to 1969 and later was state attorney general, developing a reputation as a hard-charging activist for consumer rights.

In the U.S. Senate, he assumed the seat vacated by retiring Sen. Sam J. Ervin Jr. (D), who was rocketed to national attention as chairman of the Senate committee that investigated the Watergate scandal during the Nixon administration.

Mr. Morgan accumulated a voting record that “defies ideological labels,” according to the Almanac of American Politics. He was liberal on some issues but conservative on others, and he gained his greatest prominence on the matter of the Panama Canal.

Sen. Robert B. Morgan outside the Capitol in 1979. (William E. Sauro/The New York Times)

The canal and surrounding area, a critical waterway that connects the Pacific and Atlantic oceans, had been controlled by the United States since 1903, an arrangement that by the 1970s had caused increasing friction with the Panamanians.

President Jimmy Carter, elected in 1976, became persuaded that authority over the canal should reside with the Panamanian government. Opponents of his position regarded any treaty to that effect as a “giveaway.”

Mr. Morgan was initially among those opponents. He changed his position after visiting Panama as a member of the Senate Intelligence Committee and meeting with the CIA contingent there and with Panamanian leaders.

“Our relationship with Panama on the future of the canal is a festering sore and affects our relations not only with Latin America but with the rest of the world,” the News and Observer of Raleigh, N.C., quoted Mr. Morgan as saying in a 1977 speech. “Our global position as world leader and a moral standard bearer is seriously weakened by maintaining this vestige of colonialism.”

Two treaties were hammered out, one establishing the right of the U.S. military to defend the canal’s neutrality and the other giving control of the canal to Panama by 1999.

Together, Mr. Morgan argued in comments reported by the Charlotte Observer, the treaties would “allow us to maintain our vital interests in that country while allowing the Panamanians the dignity and benefit of living on their own land — a fact which we would surely insist upon in our part of the United States. It is just plain right to do so.”

The treaties were signed in 1977 but faced withering opposition led in part by North Carolina’s senior senator, Jesse Helms (R). In 1978, the Senate ratified the treaties by a margin of 68 to 32 — just one vote more than the minimum required.

In 1980, Mr. Morgan was challenged by a relatively unknown law professor, Republican John P. East, who attracted the support of Helms’s political machine. In his campaign, East told voters that Mr. Morgan had “voted to give your Panama Canal away.”

In one of many television ads targeting the Democrat, Helms asserted that “what we need is a real American in the Senate. A real Christian in the U.S. Senate.”

“Nothing was said about me not being a real American or a real Christian,” Mr. Morgan told People magazine after his defeat, “but it was certainly obvious what Helms meant.”

Mr. Morgan lost the race by roughly 10,000 votes.

Robert Burren Morgan, a son of farmers, was born Oct. 5, 1925, in Lillington, N.C.

He served in the Navy before receiving a bachelor’s degree from what is now East Carolina University in Greenville, N.C., in 1947 and a law degree from Wake Forest University in North Carolina in 1950.

He returned to the Navy to serve in the Korean War and remained in the Navy Reserve until 1971, attaining the rank of lieutenant commander. He later served in the Air Force Reserve, retiring as a lieutenant colonel.

In 1960, Mr. Morgan managed the unsuccessful gubernatorial campaign of I. Beverly Lake, a staunch segregationist, who lost his bid for the Democratic nomination to Terry Sanford, a more progressive politician who was elected governor that year. Lake had been Mr. Morgan’s professor at Wake Forest.

After his Senate tenure, Mr. Morgan ran the North Carolina State Bureau of Investigation and the North Carolina Center for Voter Education, an organization that worked on campaign finance issues.

Mr. Morgan’s daughter Alice Jean Morgan died in 1967. Survivors include his wife of 55 years, the former Katie Earle Owen of Buies Creek; two daughters, Mary Morgan of Raleigh, N.C., and Margaret Morgan Holmes of Chapel Hill, N.C.; a foster son, Rupert Tart of Angier, N.C.; and five grandchildren.

“I made a lot of decisions, and some cost me politically, cost me dearly,” Mr. Morgan told the Fayetteville (N.C.) Observer in 2012, looking back in particular on his votes on the Panama Canal treaties. “But they were decisions I made with a clear conscience.”