From this article in the L.A. Times, July 06:

After his [Khamenei’s] deputies for weeks equated peaceful demonstrators with rioters, Khamenei said it was foreigners [that] had described Iranian people as rioters.

“Rioters were a minority who received budget allocated by some Western governments,” he said.

“It is natural that some Iranians feel depressed and sad due to the failure of their preferred candidate,” he said. “The Islamic regime feels compelled to deal with those who threaten people and disturb their life and serenity. But the authorities should be careful to not mistake enemy for friend and consider friends as enemies just for a single error.”

The meaning of Khamenei’s statements can be interpreted in several ways depending on whom one thinks his intended audience is. It wouldn’t be surprising if it’s all of the following.

If the target audience is the Iranian people that he offended (basically everyone except his very devout followers), the intent is to say:

“Look, I feel your pain. It was not my intent to have the Revolutionary Guards, Basij, Police, and mercenaries loose on you and your friends and family like that. When I held Friday prayers and warned that any bloodshed would be the fault of the Mousavi supporters, what I meant was that I don’t have full control over these different forces! You understand, don’t you? If you make them angry by holding any more demonstrations, peaceful or otherwise, they make take matters into their own hands and, well, that will be your fault. Now that it happened, it is your fault. I’m encouraging them to not think of you as the enemy just because you’re a Mousavi supporter or demonstrator in his support. You see, I am a very reasonable person.  You are free to think of me as: Your Friend.”

If, on the other hand, the target audience is his own base (primarily the Republican Guard, the Basij paramilitary forces, armed regime vigilantes), Khamenei is saying:

“Okay, I know that when I asked you to silence the protesters and there turned out to be a lot more of them to silence than you expected, I put your comfortable positions at risk a little. Most people don’t like you as much anymore.  I hope I haven’t let you down by doing so. But while you were doing such a good job shutting up the protestors I wasn’t able to stop some of what you had to do from leaking to the media — the same media that has always played a role in harming you! Media like the BBC, pawns of the British! And Twitter.  And throw in the foreign governments and their secret services! THESE are the bigger enemy, not the Mousavi supporters, who although very stupid non-believers, don’t deserve to necessarily be killed or beaten-the-shit-out-of. Maybe you should lower the volume a little. It’s starting to get a little embarrassing for me. As my good friends and family, you understand. You are free to think of me as: Your Friend.”

If Khamenei is addressing the majority of the mullahs in Qom, the Grand Ayatollahs and the entire religious establishment of the system, on whom he is dependent for a cloak of religious authority in which he can shroud himself in, for legitimacy in the eyes of the followers of Ayatollah Khomeini, who had much greater religious authority than he:

“Listen, I know you don’t like what I’m doing, but too bad. What are you going to do about it? I’m the Supreme Leader of the Iranian Nation! You know what that means? Let me enlighten you. It means that I control the armed forces. Which means I pretty much control whether you get to enjoy your multiple wives and ghormeh sabzi or sharing a prison cell in the lunatic ward at Evin Prison. Of course you are free to say and do what you like.  Afterall, this is a free country. And I dare you to test this. Your choice now. I have asked the protectors of the revolution to forgive you and not think of you as enemies. For now. So shut up. The revolution is mine.  You are free to think of me as: Your Friend.”

If the Supreme Leader was talking to the British:

“How did you like the fact that with such ease I was able to have 9 of your embassy staff employees arrested and interrogated then released, just like that? I’m keeping one of them.  Fair trade.  Someone has to pay the price for the blood that has been spilled in the streets.  I’m sure you understand. You are free to think of me as: Your Friend.”

If he is addressing Obama:

“I’m still willing to let one of my underlings entertain the idea of talking to you if the possibility of this provides an outlet for popular dissent against on my regime. You are free to think of me as: Your Enemy. Down with the U.S.”

To everyone else:

“Dirt on your heads!”