John W. Mashek, a reporter and columnist who covered national politics for nearly half a century for U.S. News & World Report, The Boston Globe and other publications, died Tuesday in Rockville, Md. He was 77 and lived in Washington. The apparent cause was a heart attack, his son William said. Mashek was a young reporter at The Dallas Morning News in 1960 when the paper sent him to Washington to cover Texas' high-powered congressional delegation, which included Senate Majority Leader Lyndon B. Johnson and House Speaker Sam Rayburn. After working briefly as a press spokesman at the Justice Department under Attorney General Robert F. Kennedy, he was hired by U.S. News & World Report in 1964 to open its Southwest bureau in Houston. There he reported on the space program, the civil rights movement and President Johnson's visits to the summer White House. He became the magazine's chief congressional correspondent in 1970. Four years later, as Gerald R. Ford took office as president, Mashek was named White House correspondent. In 1978, he became the magazine's political editor. After a brief stint as national correspondent for The Atlanta Constitution, Mashek was hired by The Boston Globe in 1988 to report from its Washington bureau. He appeared as a panelist on nationally televised presidential and vice presidential debates during the 1984, 1988 and 1992 election campaigns. After retiring in 1995, he wrote opinion articles for U.S. News & World Report and, making the transition to electronic journalism, maintained his own blog, where he expressed liberal opinions on politics and social issues. Affable and courteous, Mashek showed a knack for cultivating high-level sources and maintaining friendships with ideological foes. 'The liberal readers of this blog may be surprised or even angered to read that the Prince of Darkness and I are friends,' he wrote last year in an appreciation of the conservative columnist Robert D. Novak, who died in August. 'That's the way it is.' John Walter Mashek was born Dec. 9, 1931, in Sioux Falls, S.D. He spent the last two years of high school in Fargo, N.D., where he played semiprofessional baseball and coached an American Legion team whose lineup included Roger Maris. After attending North Dakota State University, he transferred to the University of Minnesota, where he studied journalism and political science and was the sports editor of the student newspaper. He received a bachelor's degree in 1953. In the Army, which he entered straight out of college, he served as a public information officer at Fort Hood, near Killeen, Texas. Unofficially, one of his most important assignments was to make sure football players from the Big 10 were sent to Fort Hood, whose team was locked in a fierce rivalry with Fort Sill in Oklahoma. Mashek began working as a cub reporter for The Morning News in 1955, covering the courts. That year he married Sara Allen Stone, who survives him. In addition to their son William, of Bethesda, Md., he is also survived by his sons Thomas, of Swarthmore, Pa.; David, of Pittsburgh; and James, of Biloxi, Miss.; a sister, Maureen, of Edina, Minn.; and seven grandchildren. 