At the time of the surrender on May 7, 1945, Nazi forces had all but disintegrated. Hitler had committed suicide and Soviet forces had already taken Berlin, which resulted in 70,000 Nazi soldiers putting down their arms.
The failure of Nazi troops to check this advance resulted in them having no choice but to sign a treaty of unconditional surrender. The declaration of surrender stipulated that Nazi Germany recognize the authority of both the Soviet Union and the Allied Forces. Nazi forces also had to immediately cease hostilities and remain in their bases. The signed Act of Surrender (click to enlarge) went into effect on May 8, 1945.
Immediately after the surrender, Supreme Allied Commander Dwight D. Eisenhower sent out a top secret cable announcing unconditional surrender of Nazi Germany and the victory of the Allied Forces.
John S. D. Eisenhower, the son of General Eisenhower, recounts the moment of Germany's total surrender in his book "The Bitter Woods: The Battle of the Bulge":
General Eisenhower was sitting in his office awaiting the outcome of the surrender negotiations. Past the desk of his secretary and into the office came the Nazis, erect and cold. Eisenhower stood up. Rigid, and fixing a cold eye on his enemies, he demanded, "Do you understand all the provisions of the document you have just signed?"
"Ja!"
"You will, officially and personally, be held responsible if the terms of this surrender are violated, including its provision for German commanders to appear in Berlin at the moment set by the Russian High Command, to accomplish formal surrender to that government. That is all."
The Nazis saluted and left, and Eisenhower relaxed. A few minutes later he sent a message to the Combined Chiefs of Staff: "The mission of this Allied Force was fulfilled at 0241, local time, May 7th, 1945."
Although these documents put an end to the war with Nazi Germany, the Empire of Japan continued to fight for an additional four months before it finally surrendered on Sept. 2, 1945.
Only once Japan surrendered was World War II officially brought to a close.