Commander Sarah West
Commander Sarah West is the first woman to captain a British naval warship. University of Hertfordshire

The first female officer to be put in charge of a major Royal Navy warship has left her post amid claims she had an affair with one of the officers in her command.

It is understood that Commander West left the ship, the HMS Portland, during a mission in the Caribbean after allegations of an affair with another officer on board the ship emerged.

The Ministry of Defence said Commander Sarah West is annual leave and has not confirmed the allegations of an affair.

But it acknowledged that it was "aware of a complaint of a breach of the code of social conduct" on board the ship, and was "taking [it] seriously".

"Anyone who is found to fall short of the Royal Navy's high standards can expect to face appropriate action," a spokesperson said.

The Navy's code of social conduct governs personal relationships between its officers. Relationships are not permitted if they compromise operational effectiveness or undermine trust and cohesion between officers.

It is not clear when Commander West left the frigate. She had been on board HMS Portland since January on a deployment. The ship is still in the Caribbean, commanded by her second-in-command, and is due to return to its base in Plymouth shortly.

Commander West, 42, from Grimsby in Lincolnshire, took charge of the frigate HMS Portland in May 2012, just four months after being made a commander.

Cdr West said at the time: "Taking command of HMS Portland is definitely the highlight of my 16 years in the Royal Navy so far."

She added: "It is a challenge that I am fully trained for and ready to undertake."

If Commander West is found to have breached the Royal Navy code, she could face sanctions, including being removed from command.