Aboard a starship the first officer was the second-in-command, just below the captain. On a Starfleet starship, the first officer had the following functions:
In Starfleet the position was usually held by an officer with the rank of commander or lieutenant commander. The position was also referred to as executive officer, or XO
In Starfleet's early period of existence, the first officer would accompany the captain on landing parties, depending on the situation.