(a) Except as stated in section (c) of this Rule, an attorney shall not represent a client or, where representation has commenced, shall withdraw from the representation of a client if:
(1) the representation will result in violation of the Maryland Attorneys' Rules of Professional Conduct or other law;
(2) the attorney's physical or mental condition materially impairs the attorney's ability to represent the client; or
(3) the attorney is discharged.
(b) Except as stated in section (c) of this Rule, an attorney may withdraw from representing a client if:
(1) withdrawal can be accomplished without material adverse effect on the interests of the client;
(2) the client persists in a course of action involving the attorney's services that the attorney reasonably believes is criminal or fraudulent;
(3) the client has used the attorney's services to perpetrate a crime or fraud;
(4) the client insists upon action or inaction that the attorney considers repugnant or with which the attorney has a fundamental disagreement;
(5) the client fails substantially to fulfill an obligation to the attorney regarding the attorney's services and has been given reasonable warning that the attorney will withdraw unless the obligation is fulfilled;
(6) the representation will result in an unreasonable financial burden on the attorney or has been rendered unreasonably difficult by the client; or
(7) other good cause for withdrawal exists.
(c) An attorney must comply with applicable law requiring notice to or permission of a tribunal when terminating representation. When ordered to do so by a tribunal, an attorney shall continue representation notwithstanding good cause for terminating the representation.
(d) Upon termination of representation, an attorney shall take steps to the extent reasonably practicable to protect a client's interests, such as giving reasonable notice to the client, allowing time for employment of another attorney, surrendering papers and property to which the client is entitled and refunding any advance payment of fee or expense that has not been earned or incurred. The attorney may retain papers relating to the client to the extent permitted by other law.