B. to end the military occupation of Japan by the United States
The Treaty of San Francisco, officially known as the Treaty of Peace with Japan, was signed on September 8, 1951, and one of its primary purposes was to officially end the state of war between Japan and the Allied Powers and to conclude the military occupation of Japan by the United States and other Allied forces following World War II.