
209 Cal.App.3d 1353 (1989)
257 Cal. Rptr. 749
PIONEER TAKE OUT CORPORATION, Plaintiff and Respondent,
v.
DINESH C. BHAVSAR, Defendant and Appellant.
Docket No. E004675.
Court of Appeals of California, Fourth District, Division Two.
March 31, 1989.
*1354 COUNSEL
Timothy H. Fine, Garry Koenigsberg, Patrick J. Carter and Robert L. Gorman for Defendant and Appellant.
Marylin Jenkins Milner and Coudert Brothers for Plaintiff and Respondent.
OPINION
HOLLENHORST, J.
This matter was commenced as an unlawful detainer in the trial court. Based upon certain provisions in a franchise agreement calling for arbitration where a "controversy or claim" arose, defendant moved for an order compelling arbitration. The trial court denied the request and defendant now appeals.

FACTS
Plaintiff and defendant have entered a license agreement for the sales of plaintiff's food products. Plaintiff has also subleased the location of the *1355 restaurant in Rialto, California. The license agreement or franchise agreement is a separate document from the sublease although the license agreement is incorporated into the sublease by reference. The sublease provides in part that if the license agreement is terminated, the plaintiff has the option of terminating the sublease.
In the license agreement, there is an arbitration clause which provides that controversies "relating to this Agreement, or any breach thereof" must be arbitrated. Plaintiff is permitted to go to court to apply for a writ of possession, but only "with respect to [defendant's] default in the payment of money."[1]
On December 23, 1986, defendant received a letter from plaintiff notifying him he was delinquent in reporting and payments of rent, royalties, advertising charges and other miscellaneous charges. Subsequently, defendant received another letter from plaintiff informing him that because of his failure to cure all the deficiencies outlined in the December 23 letter, plaintiff had elected to terminate his license agreement. Based upon the decision to terminate defendant's license, plaintiff served upon defendant a five-day notice to quit. Plaintiff attached as the reason for the notice to quit, the letter outlining alleged breaches of the license agreement and the letter terminating the license. The unlawful detainer complaint was then filed on January 23, 1987.
In defendant's answer to the unlawful detainer complaint, defendant asserted several affirmative defenses to the underlying termination of the license. Included in these defenses was a request to enforce the mandatory arbitration provision of the license agreement. After several law and motion matters were heard on this matter, the court ruled on the issue of whether the arbitration clause of the license agreement required arbitration in this unlawful detainer action. The court found that the arbitration clause of the license agreement did control notwithstanding the nature of the action since the notice to quit was based upon alleged breaches of the license agreement. The court also found that a class action lawsuit involving the parties to the instant action as well as other licensees was pending in Los Angeles Superior Court, and that lawsuit relates to the same series of transactions as the instant matter.
*1356 In a subsequent hearing, the court heard argument and ruled on the issue of the request for arbitration in light of the pending lawsuit in Los Angeles Superior Court. The court ultimately held that because of the possibility of conflicting or inconsistent rulings between the two cases with similar issues, that enforcement of the arbitration provision would be inappropriate. After denying the request for arbitration, the court sustained plaintiff's demurrers to defendant's third alleged affirmative defense, invalid service, fourth affirmative defense, nonforfeiture, and sixth affirmative defense, noncompliance with the Franchise Relations Act. The court found that these affirmative defenses were not before the court in an unlawful detainer notwithstanding the underlying nature of the action.
On appeal defendant contends the trial court abused its discretion by refusing arbitration without decreasing the likelihood of conflicting rulings.

DISCUSSION
In our review of the trial court's ruling we find the issues have been appropriately narrowed on appeal to the choice of remedy under the instant factual situation. Code of Civil Procedure section 1281.2 provides: "On the petition of a party to an arbitration agreement alleging the existence of a written agreement to arbitrate a controversy and that a party thereto refuses to arbitrate such controversy, the court shall order the petitioner and the respondent to arbitrate the controversy if it determines that an agreement to arbitrate the controversy exists, unless it determines that: .... [¶] (c) A party to the arbitration agreement is also a party to a pending court action or special proceeding with a third party, arising out of the same transaction or series of related transactions and there is a possibility of conflicting rulings on a common issue of law or fact. For purposes of this section, a pending court action or special proceeding includes an action or proceeding initiated by the party refusing to arbitrate after the petition to compel arbitration has been filed, but on or before the date of the hearing on the petition.... [¶] If the court determines that a party to the arbitration is also a party to litigation in a pending court action or special proceeding with a third party as set forth under subdivision (c) herein, the court (1) may refuse to enforce the arbitration agreement and may order intervention or joinder of all parties in a single action or special proceeding; (2) may order intervention or joinder as to all or only certain issues; (3) may order arbitration among the parties who have agreed to arbitration and stay the pending court action or special proceeding pending the outcome of the arbitration proceeding; or (4) may stay arbitration pending the outcome of the court action or special proceeding."
(1a) In the instant matter the court found that arbitration was required given the language of the licensing agreement and the circumstances underlying *1357 the unlawful detainer. The court also found that another action was pending involving the parties and the possibility of conflicting rulings. The court's initial ruling at the motion to compel arbitration was to order arbitration but stay that order pending the resolution of the Los Angeles matter. Subsequently, however, the court decided against an exercise of discretion in this fashion and refused to enforce the arbitration agreement. In our view, the court's initial analysis of the factual situation presented herein was correct. Our review of the record demonstrates the following to be true: (1) that Pioneer was attempting to litigate the franchise agreement under the guise of unlawful detainer thereby circumventing the arbitration clause; (2) the court further recognized that defendant's affirmative defenses could not be litigated in an unlawful detainer action and sustained Pioneer's demurrers; (3) the court recognized that an arbitration could lead to inconsistent results with the pending Los Angeles matter and denied the motion to arbitrate while recognizing that an agreement did give defendant the right to require arbitration but for the exception set forth in Code of Civil Procedure section 1281.2; (4) and finally, the court was willing to afford Pioneer an opportunity to amend its unlawful detainer pleading to limit the right of possession to the failure to pay rent which eliminated reliance upon the franchise agreement. In our view, the court appropriately analyzed the competing interests in its first tentative ruling and that ruling should now be enforced as the appropriate exercise of discretion in this matter.
(2) In Shamblin v. Brattain (1988) 44 Cal.3d 474 [243 Cal. Rptr. 902, 749 P.2d 339], our Supreme Court reiterated the general rule that "The appropriate test for abuse of discretion is whether the trial court exceeded the bounds of reason. When two or more inferences can reasonably be deduced from the facts, the reviewing court has no authority to substitute its decision for that of the trial court." (Id., at pp. 478-479.) Accordingly, we "extend all legitimate and reasonable inferences to uphold the judgment." (In re Marriage of Connolly (1979) 23 Cal.3d 590, 597 [153 Cal. Rptr. 423, 591 P.2d 911].) In Connolly, the court noted: "Although precise definition is difficult, it is generally accepted that the appropriate test of abuse of discretion is whether or not the trial court exceeded the bounds of reason, all of the circumstances before it being considered." (Id., at p. 598.) "Judicial discretion must be guided and controlled by fixed legal principles; it is to be exercised impartially toward the end of substantial justice in accord with the spirit of the law." (George v. Double-D Foods, Inc. (1984) 155 Cal. App.3d 36, 48 [201 Cal. Rptr. 870].)
(1b) In the instant matter the trial court was, in a sense, presented with a series of possible legal choices once it determined another court action was pending and there existed the possibility of conflicting rulings. (Code Civ. Proc., § 1281.2, subd. (c).) Unfortunately, after correctly analyzing the competing interests in this matter, the court ultimately ruled inconsistently *1358 with its first and appropriate selection. It is quite clear from the record and the court found that the basis underlying the unlawful detainer action was the alleged breach of the license agreement. In choosing not to enforce the arbitration agreement defendant has lost the benefit of his original contract and is now placed in the predicament of litigating the alleged breaches of the license agreement in the unlawful detainer action. The possibility of rulings on common issues leading to conflicting decisions remains a problem under the trial court's order and the decisions on those issues will be made in a forum other than that originally agreed upon by the parties. In our view, the trial court reasonably could have satisfied the concerns raised by the parties by simply ordering arbitration, but staying that order pending the resolution of the Los Angeles matter. While we understand that the issue before the court is a right of possession of property normally subject to priority, as the trial court observed, the breach of the licensing agreement is inextricably intertwined with the breach of the lease. In sum, we discern no sound basis for the court's order denying arbitration in light of an alternative procedure which satisfies the contractual agreement and addresses the concern of inconsistent or conflicting rulings.

JUDGMENT
The judgment denying arbitration is reversed and the court is directed to order arbitration, staying said order pending resolution of Los Angeles Superior Court action No. CA 001009 as set forth in the provisions of Code of Civil Procedure section 1281.2, subdivision (c)(4). The order of July 24, 1987, that the affirmative defenses are not properly before the court is vacated.
Campbell, P.J., and McDaniel, J., concurred.
NOTES
[1]  The arbitration clause reads as follows: "Any controversy or claim arising out of or relating to this Agreement, or any breach thereof, including without limitation, any claim that this Agreement is invalid, illegal or otherwise voidable, shall be submitted to arbitration at Los Angeles, California, in accordance with rules of the American Arbitration Association, and judgment upon the award may be entered in any court having jurisdiction thereof; provided, however, that this clause shall not be construed to limit any of Pioneer's rights or remedies under the provisions of this Agreement, with respect to Licensee's default in the payment of money due hereunder, or under the lease or sublease of the license location, including without limitation, the right to apply to any court of competent jurisdiction for appropriate writs for recovery of possession of the premises."
