In the 17th century, a midshipman was a rating for an experienced seaman, and the word derives from the area aboard a ship, amidships, either where the original rating worked on the ship, or where he was berthed. Beginning in the 18th century, a commissioned officer candidate was rated as a midshipman, and the seaman rating began to slowly die out. By the Napoleonic era (1793–1815), a midshipman was an apprentice officer who had previously served at least three years as a volunteer, officer's servant or able seaman, and was roughly equivalent to a present-day petty officer in rank and responsibilities. After serving at least three years as a midshipman or master's mate, he was eligible to take the examination for lieutenant. Promotion to lieutenant was not automatic, and many midshipmen took positions as master's mates for an increase in pay and responsibility aboard ship. Midshipmen in the United States Navy were trained and served similarly to midshipmen in the Royal Navy, although unlike their counterparts in the Royal Navy, a midshipman was a warrant officer rank until 1912.