Can lawyers be sued if they make false accusations in court?

I don’t know how common this is in real life, but in TV shows defence attorneys often accuse someone else of a crime. Can the person they accuse sue them for slander or libel?

Nothing a lawyer says in court counts unless he is testifying.

I don’t think it’s quite as expansive as ouryL makes it out to be. My lay understanding is that lawyers have “qualified immunity” from civil liability based on non-testamentary statements made in court, but IIRC there must be a good faith basis for the statement, including accusing a party of commiting a crime.

According to Prosser and Keeton on Torts, the privilege is absolute, except that American courts hold that the statements must be relevant to to some issue in the case.