Justin Bieber was "excited, talkative, insulting, cocky" and profane when he was arrested in Miami Beach last week ... this according to official police documents.
According to the docs, a cop at the scene claimed Bieber "reeked of marijuana." Cops say Bieber's reaction was this ... "Yeah, we were smoking all night at the studio."
The officer claims Bieber was initially open to taking a "breath test" but then had a change of heart, asking the cop what would happen to his license if he refused the test.
The cops say Justin was out of it and couldn't follow basic instructions on how to provide the breath sample. The docs say "he had extreme difficulty providing a continuous breath."
The report also says Bieber wasn't blowing into the tube properly and cops thought he was deliberately undermining the test. Bieber then became "agitated" and told the officer he was "blowing into the hose like he blows into his trumpet."
Cops say he admitted he took medications for anxiety, saying "My mom takes care of all that stuff for me."
As TMZ first reported, the docs say Bieber blew a .014, which is barely perceptible.
And cops say he flunked the field sobriety test miserably -- his balance was off, he would sway, he couldn't smoothly follow a moving object and couldn't do the finger to nose test with his eyes shut.