For most of its five century history, the Royal Navy saw fit to allow women to serve only as carved figureheads or by lending their names to military vessels. But now the navy is set to hand command of a frontline warship to a female officer for the first time.

Lt Commander Sarah West is to graduate in time for her 40th birthday from the mine-hunting and coastal defence "minnows" of the service to a frigate more powerful than the whole of Lord Nelson's fleet.

She will take command in April of HMS Portland, whose arsenal has been used in anger against Somali pirates and cocaine smugglers in the Caribbean.

West, an expert in underwater warfare and large-scale naval planning, took a law degree on top of her university maths honours while serving in the Middle East.

She is also due to achieve the rank of commander, a promotion due at the end of the year and only a step away from captain and then the various categories of admiral.

She earned the appointment by showing "leadership, confidence, moral courage, sound judgment and excellent people skills" since joining up in 1995, five years after the five centuries-old ban on women was rescinded.

Her training on HMS Battleaxe armoured her against inevitable quips at the first generation of navy women, and her previous command of four smaller vessels will help the challenge of Portland, a Type 23 frigate with 185 crew. She has earned praise for mastery of ships' weapons systems and skilled work on mine clearance off Iraq.

Earlier this year she led the 40-strong crew of minehunter HMS Shoreham through the West Sussex port of the same name to receive its official freedom. Bayonets were fixed, colours flown and drums beaten and West described her "pride at exercising this ancient right in our favourite town".

She was born and educated in Lincolnshire, like her fellow shatterer of ancient glass ceilings, Lady Thatcher, and studied maths at the University of Hertfordshire before taking a warfare officer course at Britannia Royal Naval College.

Signs of a high-flying career developed in her successful role in planning international exercises, including periods at naval headquarters co-ordinating operations in the Balkans at the time of Kosovo's declaration of independence in 2008.

This followed a major logistical role in the evacuation of 4,600 UK citizens and others from Lebanon in 2006, and a spell co-ordinating the navy's contribution to operations in Iraq.

A spokesman for the Royal Navy said that other women were achieving senior ranks in good numbers as well as joining the service at all levels.

On average, women form between 15% and 20% of ships' crews and are only barred from posts in the Royal Marine Commandos, mine clearance involving diving, and submarines. The submarine ban is currently under review and is expected to be eased.

"This appointment is good news," the spokesman said. "The Royal Navy is committed to ensuring equality of opportunity for all its personnel to enjoy challenging, fulfilling and rewarding careers."

Historic attitudes to women's place in society were reinforced at sea by superstitions about bad luck, problems of space and fears of sexual licence.

Questions about courage and skill were harder to raise, given heroic archetypes such as Grace Darling, the lifeboat pioneer, and a boatload of successful pirates from Anne Bonny to Lady Killigrew and Grace O'Malley, whose crew of 200 men was even larger than HMS Portland's.

The mercantile marine also pipped the Royal Navy last year by announcing the appointment of its first woman captain, Inger Klein Olsen, to the Cunard cruise liner Queen Victoria.

Her first job was to sail it into dry dock for a refit but she then set sail with a full complement of guests.

The Ministry of Defence said that West would be commenting nearer the time of her appointment to the frigate.

Meanwhile a contributor to the women seafarer's forum of the website gCaptain offers her experience of leading a ship: "It was like having a lot of brothers who are fun to be around but also can be really annoying at times."

• This article was amended on 9 August 2011 because the original said that West was the first woman to achieve the rank of commander. The Ministry of Defence says a number of women hold this rank and above. It was was further amended on 12 March 2012. The original referred to the Portland as a Type 32 frigate with 185 crew. This has been corrected.