William Earle Geoghegan, 77, an authority on naval history and shipbuilding who had worked for the Smithsonian Institute since 1957, died Friday at his home in Alexandria after a heart attack.

Mr.Geoghegan joined the Smithsonian's Museum of History and Technology as a special assistant to the late Howard I. Chapelle, who had just been named the museum's transportation curator and naval history section head.

As a professional draftsman, builder of ship models, historian, and former sailor, Mr. Geoghegan brought a variety of skills to his job. The main task facing Chapelle and Mr. Geogehan was expanding the Smithsonian's collection of models and plans in its watercraft exhibits. And between 1960 and 1975, some 115 were added.

Mr. Geogehan was an authority on naval history of the Civil War and was an expert on the construction and history of the cruisers and ironclad gunboats of that period.

He helped supervise the Smithsonian's naval display that marked the Cival War centennial in 1961. For the past decade, he had been involved in the restoration of the Union ironclad Cairo, which was raised from the Yazoo River in Mississippi in 1964.

Although formally retired from the Smithsonian at age 70, Mr. Geoghegan was recalled on a part-time basis in 1975 to lend his expertise to a variety of tasks. He became well known to history buffs and boaters as administrator of the boat plan service in the Smithsonian's Transportation Division.

Mr. Geoghegan was a native of Baltimore. One of his grandfathers had been a square rig sailor on the "coffee clippers" that piled between Brazil and Baltimore. His father had been first mate on a Chespeake Bay steamer.

At the age of 16, Mr. Geoghegan began working during the summer vacations as a lookout and quartermaster on Chesapeake Bay steamers. But he wanted to be an artist rather than a sailor.

It was while attending the Maryland Institute of Design that he built his first ship model, Christopher Columbus's flagship, the Santa Maria.

He worked as a model builder in Baltimore and New York before his skill in model building, his friendship with Chapelle, and his enthusiasm for the conflict he called "the War of Northern Aggression" brought him to the Smithsonian.

In addition to his work at the Smithsonian, Mr. Geoghegan had models he built become part of the collections at the Mystic Seaport Museum in Mystic, Conn., and the Mariners Museum near Norfolk.

Surviors include his wife, Ruth E. Geoghegan of McLean.Two other marriages ended in divorce.

It is suggested that expressions of sympathy be in the form of contributions to the H.I. Chapelle Memorial Library, Chesapeake Bay Museum, Saint Michaels, Md.