Hail Sithis!

After a failed assassination attempt on Emperor Titus Mede II and the near destruction of the Dark Brotherhood, it's time to finish the Brotherhood's greatest contract in centuries. This is the final contract-based quest in the Dark Brotherhood questline, but not the final quest.

Preparations
The quest begins by talking to Nazir and telling him the Night Mother has spoken, and thus the contract is still on. He will direct the Dragonborn to Amaund Motierre, who is currently hiding out in the back room of The Bannered Mare in Whiterun.

Amaund will reveal that the Emperor is on The Katariah, which is a ship about to leave Skyrim. He also mentions that Commander Maro will be at the East Empire Company Warehouse docks, should the Dragonborn wish to pay him a visit.

(Optional) Kill Commander Maro
Maro can be found on the docks of the East Empire Company Warehouse near an unnamed docked ship. It's possible to walk onto the archway over the water and shoot him from afar, but unless he is killed with the first shot, he will start moving around, fighting with Shadowmere. A more direct way is to go down to the docks and kill him, then flee from the guards towards the Katariah. However, this will earn a bounty if witnessed, and there are very few hiding places on the docks for sneak attacks. The simplest way is by talking to Maro with a clean bounty - he will attack, and the guards may help kill him (at the least, they will be indifferent and no bounty is incurred unless a guard is accidentally hit). If the Stormcloak quest line is finished, there will be Stormcloak Guards on the docks that will help kill Maro.

Kill the Emperor!
The next step is to swim to the Katariah, which is anchored in the water under Solitude. To get inside, the Dragonborn should swim around the hull to the anchor chain, then activate it. If The Elder Scrolls V: Dragonborn is installed, and the Dragonborn knows all three words for the Bend Will shout, riding a dragon and landing it on the ship is also an option.

On board the ship, there will be several low level Sailors and more dangerous Penitus Oculatus agents. The winding, narrow passages inside the ship offer ample cover for a stealthy approach, but none of the ship's occupants are especially powerful. Alerting one will not necessarily alert the rest of the ship, but only those enemies who happen to be close by.

Proceeding south through a dining room leads to stairs up to the main deck. A locked door (expert) to the aft (north) cabins is at the top of these stairs. The key to this door (and all doors on the ship) is held by Captain Avidius, who can be found in a forward cabin (in the southwest corner of the ship). The key can also be obtained by killing the lieutenant who is in the room directly below the Emperor. Ether the key can be used or the lock picked to allow entrance to the aft cabin area. Upon entering, there is a room to the left with one Penitus Oculatus agent, and one to the right with two that has smoke rising from the floor. At the north end of the area is another room with Lieutenant Salvarus. Up the stairs in either the northwest or northeast corner is a master-level locked door to the Emperor's Quarters (that can be opened with the key).

Once inside, the Emperor will start talking. He accepts his death, stating that this is destiny. He will ask a favor however: kill whomever assigned the contract. He gets up from his chair and turns his back to stare out a window, allowing an easy kill.

Before leaving, the door to the left should not be overlooked. It leads to the Emperor's sleeping quarters with jewelry, gems, and armor to be taken. Two sets of Emperor's Robes can be looted - one off the Emperor and one set in the bedroom. It is a possible location for Meridia's Beacon.

Report to Amaund Motierre
After the Emperor has been killed, there is a conveniently placed door to his right that leads outside. After jumping off and escaping the ship, the Dragonborn should return to the Bannered Mare to talk to Amaund. He reveals the payment is in a dead drop in Volunruud. In the same chamber where Amaund was first met, there is a 20,000 payment in an urn.

(Optional) Kill Amaund Motierre
Once Amaund gives the location of the reward, he can be killed. This can also be done after returning from Volunruud, or at any later date. This will yield no particular reward, except a handful of valuable gems which can also be pickpocketed from his inventory without killing him.

Report to Nazir
After returning to Nazir at the Dawnstar Sanctuary, he asks how much Amaund left as a reward. The Dragonborn can lie about the reward, but it doesn't change anything. Either way, Nazir will suggest speaking to Delvin Mallory in Riften about repairing the Dawnstar Sanctuary with the gold from the reward. In return, Nazir says that once the repairs are complete, he will start recruiting new members to the Dark Brotherhood. This completes the quest and begins the next, Where You Hang Your Enemy's Head. The gold is kept as the Dragonborn's reward - upgrading the Sanctuary is optional.

When climbing the stairs to exit the Sanctuary after the quest is complete, the Night Mother will speak to the Dragonborn, asking him or her to come close to her to receive her words. This then begins the quest The Dark Brotherhood Forever.

Trivia

 * Upon arrival at the East Empire Company docks, the Dragonborn may be accosted by a Solitude guard demanding that the bounty must be paid that was earned in the assassination of the imitation Emperor.
 * After this quest, guards in any hold may mention the Emperor's death.
 * Windshear, a unique Scimitar, can be obtained from the bowsprit of the ship.
 * The Brothers of Darkness book is on the Emperor's Desk.
 * In the cabin next to the room with the workbench, a sailor can be found crouched next to a bed. Inside the cabin, a Penitus Oculatus and another sailor will both be found dead. This implies that the first sailor killed them, or it may simply be a sick-bay.
 * The Emperor will attack the Dragonborn if they turn into a werewolf even after he gives permission to kill him. He will also attack if he catches the Dragonborn pickpocketing him, or if the Drain Vitality shout is used on him but he is not killed.
 * If the Dragonborn is at stage four of vampirism, the Emperor will refuse to speak to them. Having installed prevents this.
 * The skill book King which increase the two-handed skill is on the deck on a throne near the steering wheel
 * If the Dragonborn does not tell the Emperor that he or she will kill the originator of the contract, then there will be no quest objective to kill Amaund.

Bugs

 * After finishing the Civil War questline for the Stormcloaks, killing the Emperor may cause Solitude guards to be hostile permanently and not give the option of paying off a bounty. To avoid this, use the console and enter  to complete the objective of killing the emperor (without killing him), and   to proceed to the next stage of the quest.
 * Using the command  will kill him without making the guards hostile.
 * There is a chance that after assassinating the Emperor, it will be impossible to fast travel or wait. The message: "You cannot fast travel / wait while guards are pursuing you" will appear, even if the Dragonborn is in another hold outside Solitude. Using the wait command, if allowed, removes this. If waiting is disabled, jumpinbg off the boat and swimming to shore, then look toward the boat and waiting for the red dots indicating enemies to disappear, should allow fast travel.
 * Amaund may fall through the floor if killed while he is sitting in his chair, making his inventory inaccessible.
 * It is possible to only receive 100 from the urn, which there appears to be no fix for. Saving before opening the urn is recommended. PC users can use console commands to obtain the missing gold. Open console command and type in   to get the remaining 19,900 Gold.
 * The Katariah may not render, and all the occupants will spawn where they are meant to and fall into the water below. It's possible to find the anchor entrance and enter, at which point the other characters will also start entering from outside, and can be dispatched easily. This may be fixed by entering through the anchor port, or reloading a previous save from before discovering the location.
 * After receiving the Hail Sithis mission, entering the river where the Katariah resides may crash the system.
 * After completing the Civil War for the Stormcloaks, with the Emperor dead, the Stormcloak guards may still say talk about the Emperor as if he's alive.

Achievements
Heil Sithis Gloire à Sithis! Слава Ситису!