(Reuters) - Edward Brooke, the Massachusetts Republican who was the first African-American to be popularly elected to the U.S. Senate, died on Saturday at the age of 95, the state Republican Party said.

Brooke was Massachusetts attorney general when he was elected to the U.S. Senate in 1966, at a time when the country was gripped by racial unrest.

Before his election, there were two other African-American senators shortly after the Civil War. But until early in the 20th century, senators were picked by state legislatures and not by popular vote.

In the Senate, Brooke joined a small band of liberal Republicans who often went against the wishes of the Republican president, Richard Nixon.

Brooke opposed the buildup of troops in Vietnam, and later in the middle of the Watergate scandal, he became the first Republican senator to call for Nixon to resign.

He was re-elected in 1972 by an almost 2-1 margin. But by the time he ran for a third term in 1978, he was involved in a public divorce proceeding. And questions were raised about a sworn statement he made regarding a $49,000 loan that he later admitted was a "misstatement and a mistake."

His popularity plummeted and he was defeated by Democrat Paul Tsongas by 55 to 41 percent.

Brooke was born in Washington, D.C., on Oct. 26, 1919. His father was an attorney for the Veterans Administration.

Brooke entered Howard University at the age of 16, fought in World War Two and earned a law degree from Boston College.

As a lawyer, he lost several political bids before being appointed chairman of the Boston Finance Commission and then won the job of attorney general in 1962, the first African-American in the country to rise to that high state office.

As attorney general, he oversaw the investigation into the case of the "Boston Strangler," a serial killer who terrorized women in New England.

After leaving the Senate he returned to private law practice.

In 2002 Brooke was diagnosed with breast cancer and became a national leader in raising awareness of the disease in men, which occurs much less frequently than in women.

Brooke's name surfaced in gossip columns in 2008 when TV journalist and interviewer Barbara Walters said in her autobiography that she had an affair with the senator in the 1970s.