In his famous poem "O Captain, My Captain," Walt Whitman is referring to Abraham Lincoln. The "fearful trip" which has just concluded is the American Civil War.
Walt Whitman, who had lived in Washington during most of the Civil War, was a great admirer of Abraham Lincoln. "O Captain, My Captain" expresses poignantly the deep sense of grief and despair which completely overshadowed the feeling of relief that the long war was finally over when Lincoln was assassinated in its immediate aftermath. Published in 1865, a little over six months after Lincoln's death, the poem became arguably Whitman's most popular work, and frequently appears in anthologies. Current readers of the poem may remember that it was used in the 1989 movie Dead Poets' Society, starring Robin Williams.