Congress passed the Lee Resolution on July 2, 1776, before adopting the Declaration of Independence.
Richard Henry Lee of Virginia introduced the resolution in Congress on June 7. It proposed that the United Colonies should be free and independent states, that their political connection with Great Britain should end, and that the colonies should form foreign alliances and a confederation.
Congress approved the independence portion on July 2. Two days later, on July 4, it adopted the Declaration of Independence, which explained and justified the decision. The Declaration therefore followed the formal vote for independence rather than creating that vote from nothing.
John Adams believed July 2 would be remembered as the great national anniversary. Instead, July 4 became the celebrated date because it was printed on the adopted Declaration and became central to public commemorations.