El Salvador has become the first country in the world to officially classify Bitcoin as legal currency.
Congress approved President Nayib Bukele's proposal to embrace the cryptocurrency, with 62 out of 84 possible votes on Tuesday night.
The president said the government had made history, and that the move would make it easier for Salvadoreans living abroad to send money home.
Bitcoin will become legal tender, alongside the US dollar, in 90 days.
The new law means every business must accept Bitcoin as legal tender for goods or services, unless it is unable to provide the technology needed to do the transaction.
"It will bring financial inclusion, investment, tourism, innovation and economic development for our country," President Bukele said in a tweet shortly before the vote.
He has previously said the move will open up financial services to the 70% of Salvadoreans who do not have bank accounts.
El Salvador's economy relies heavily on remittances, or money sent home from abroad, which make up around 20% of the country's gross domestic product (GDP).
More than two million Salvadoreans live outside the country, but they continue to keep close ties to their place of birth, sending back more than $4bn (£2.8bn) each year.
On Twitter, some financial and legal observers described the law change as a remarkable accomplishment and a game changer, while others raised concerns about the cryptocurrency's volatility. Experts have warned it could also complicate matters with the International Monetary Fund (IMF), where El Salvador is seeking a more than $1 billion programme.
The Congress vote happened on the same day that former US President Donald Trump said he saw Bitcoin as a "scam".
"I don't like it because it's another currency competing against the dollar," he told Fox Business.
He added that he wanted the dollar to be "the currency of the world".
Bitcoin, a virtual asset with no direct connection to the real economy, has seen large fluctuations in value over the years.
Most of the world's central banks are looking into the possibility of creating their own digital currencies. In April, the Bank of England announced it was looking into creating a digital money that would exist alongside cash and bank deposits.