
208 S.W.3d 220 (2005)
PHOENIX AVIATION MANAGERS, INC., and Old Republic Insurance Co., Appellants
v.
SOUTHERN PINE HELICOPTERS, INC., Appellee.
No. CA 03-1309.
Court of Appeals of Arkansas, Division III.
May 11, 2005.
*221 Thompson & Llewellyn, P.A., by: James M. Llewellyn, Jr., Fort Smith, for appellants.
No response.
SAM BIRD, Judge.
Appellants, who insured a helicopter owned by appellee, sought title to the helicopter salvage after paying $297,000 for a total loss. The trial court instead vested title to the salvage in appellee. We reverse and remand.[1]
The helicopter in question is a 1962 Bell Huey. It was insured for $330,000, less a ten-percent "in-motion" deductible. In March 2000, the helicopter was damaged by fire, and appellee submitted a claim to appellants. Appellants contended that coverage was excluded due to appellee's operation of the aircraft in violation of FAA regulations. On October 31, 2000, appellee sued appellants in federal court for breach of contract and bad faith. A jury trial was held on the contract claim (the bad-faith claim was dismissed on summary judgment), and a verdict of $297,000, representing a total loss of the helicopter, was rendered in favor of appellee. The verdict was affirmed by the United States Court of Appeals for the Eighth Circuit on February 26, 2003. Southern Pine Helicopters, Inc. v. Phoenix Aviation Mgrs., Inc., 320 F.3d 838 (8th Cir.2003).
The Bank of Lake Village and the Small Business Administrationwho apparently had liens on the helicoptersubsequently filed writs in Drew County Circuit Court to garnish the insurance proceeds. The circuit judge ordered appellants to pay the proceeds into the court registry pending a determination of how they should be disbursed. Appellants deposited the proceeds as ordered and filed a motion seeking the helicopter salvage.[2]
On July 28, 2003, the parties settled all aspects of the litigation except ownership of the salvage. At a hearing on the matter, appellants argued that they were entitled to the salvage based on the following provision of the insurance policy:

SALVAGE  If the aircraft has suffered physical damage or loss and the Company has paid for it, the Company is entitled to the salvage value of the aircraft *222 or any replaced parts. The Company will not accept responsibility for the aircraft or any replaced parts. It is the insured's responsibility to deliver a clear title to the aircraft to the salvage buyer upon payment by the Company of a claim for the total loss of the aircraft.
Appellee argued that appellants should have litigated their claim to the salvage in the federal action. The trial judge ruled that appellants' claim was barred by res judicata and collateral estoppel due to their failure to raise it in federal court, and he entered an order that "quieted title" to the helicopter salvage in appellee. Appellants appeal from that order. No brief has been filed by appellee.
Our standard of review is the one that we employ when purely legal matters are at issue. If the law has been erroneously applied and the appellant has suffered prejudice, the trial court's erroneous ruling is reversed. See e.g. Office of Child Support Enforcement v. King, 81 Ark.App. 190, 100 S.W.3d 95 (2003) (holding that a trial judge's conclusion of law regarding the application of res judicata is given no deference on appeal).
Appellants' argument on appeal can be divided into four points: 1) they had a right to recover the helicopter salvage upon payment for a total loss; 2) res judicata does not bar their claim to the salvage; 3) it would be inequitable for appellee to seek coverage under the policy and then repudiate the policy's salvage clause; 4) appellee should be judicially estopped from seeking the salvage. The first two points, taken together, merit reversal.
The insurance policy provides that "if the aircraft has suffered physical damage or loss and the Company has paid for it, the Company is entitled to the salvage value of the aircraft" and that the insured must "deliver a clear title to the aircraft to the salvage buyer upon payment by the Company of a claim for the total loss of the aircraft." Thus, upon appellants' payment for a total loss, appellee was required to relinquish the salvage and appellants were entitled to receive the salvage or its value. See generally Langford v. Federated Guar. Mut. Ins. Co., 543 So.2d 675 (Ala.1989), and the cases cited therein (recognizing an insurer's right to salvage upon payment for a total loss).
Moreover, the doctrine of res judicata did not bar appellants from asserting their claim to the salvage in this suit. The elements of res judicata are: (1) the first suit resulted in a judgment on the merits; (2) the first suit was based upon proper jurisdiction; (3) the first suit was fully contested in good faith; (4) both suits involve the same claim or a cause of action that was litigated or could have been litigated but was not; (5) both suits involve the same parties or their privies. Arkansas La. Gas Co. v. Taylor, 314 Ark. 62, 858 S.W.2d 88 (1993). Res judicata applies not only to issues that were actually litigated in the prior suit but to issues that could have been and therefore should have been litigated. Williams v. Connecticut Gen. Life Ins. Co., 26 Ark.App. 59, 759 S.W.2d 815 (1988). In order to determine whether res judicata applies, it must appear that the particular matter was raised and determined or that it was necessarily within the issues and might have been litigated in the previous action. Id.
In addressing this point, it is helpful to understand the nature of the former suit in federal court. According to the Eighth Circuit, which had the benefit of the district court transcript before it, appellants and appellee agreed that the helicopter was a total loss and that
the only dispute concerned the cause of the admitted loss. Southern Pine contended that the helicopter became a total *223 loss because of damage that occurred during the fire and the transportation of the helicopter for inspection afterward (this latter was also covered under the policy), whereas Phoenix contended that part of the loss resulted from causes not covered.
Southern Pine Helicopters, Inc. v. Phoenix Aviation Mgrs., Inc., 320 F.3d at 843. Our reading of the Eighth Circuit's opinion informs us that the issue in the federal lawsuit was whether the loss of the helicopter was the result of certain excluded causes; the controversy was over coverage. The extent of the loss was established as a total loss and, if the jury determined that the exclusions were not applicable, appellants would simply owe $297,000. Appellants' right to salvage, therefore, was not a defense to coverage, had no bearing on the coverage issues, and would have had no place in the trial of the federal case. Consequently, it was not "necessarily within the issues" of the federal lawsuit.
Further, appellants' right to the salvage was not an issue that "might have been litigated" in federal court because it did not arise until appellants actually paid for the total loss. Our supreme court held in Diggs v. Kansas City Southern Railway Co., 207 Ark. 111, 113, 179 S.W.2d 860, 861 (1944), that "before a counterclaim or set-off can be pleaded it must exist." There, Diggs sustained injuries at the hand of the railroad, and the railroad made various payments to him that totaled $1,856.90. Upon receipt of each payment, Diggs agreed that the amount paid would be deducted from any sum he might be entitled to receive from the railroad in the future. After receiving several payments, Diggs filed suit against the railroad and recovered $18,313.49. The railroad issued a check to him for $16,456.59, which was the judgment amount less the advance payments. Diggs argued that the railroad's right to deduct the payments was barred by res judicata because the deductions were not asserted in the lawsuit. The supreme court disagreed, stating:
Appellee [the railroad] contends it had no cause of action when Diggs' suit for damages was filed, hence it could not undertake to set-off against the plaintiff the several items advanced-because, in the first place, there was a denial of negligence and consequently the plea of non-liability. Secondly, if it be anticipated that liability would be fixed, the right of set-off arose when judgment was returned.
The statute requires a defense, in answering, to set out ". . . as many grounds of defense, counterclaim, and set-off . . . as he shall have." But before a counterclaim or set-off can be pleaded it must exist. If the money supplied be adjudged advances chargeable only against what the Company might subsequently concede it was due Diggs, arrived at "by settlement or otherwise," it could not have been pleaded until settlement had been made; or (considering the word "otherwise") until judgment. Not until then was there a principal against which the amounts could be offset.
207 Ark. at 113, 179 S.W.2d at 861.
In the case at bar, appellants were not deemed liable for the total loss until judgment was entered in the federal insurance-coverage litigation. Their entitlement to the salvage, therefore, did not arise until the litigation was concluded. As a result, appellants' right to the salvage was not an issue that "might have been litigated" in the federal lawsuit.
In light of the foregoing, we reverse and remand the trial court's ruling that appellants' claim to the salvage was barred by res judicata and that title to the *224 salvage should be vested in appellee. Our holding makes it unnecessary to address appellants' arguments regarding the inequity of appellee's receiving the salvage or the doctrine of judicial estoppel.[3]
Reversed and remanded.
PITTMAN, C.J., and GLADWIN, J., agree.
NOTES
[1]  This case is before us a second time following an order for rebriefing. Phoenix Aviation Mgrs., Inc. v. Southern Pine Helicopters, Inc., CA03-1309, 2004 WL 2603534 (Nov. 17, 2004) (not designated for publication). Appellants have filed a substituted brief that remedies the deficiencies mentioned in the rebriefing order.
[2]  Colloquies in the record indicate that the salvage was worth approximately $31,000.
[3]  We also do not address the trial court's ruling that collateral estoppel barred appellants' claim because collateral estoppel clearly does not apply in this case. It bars relitigation of issues that were actually litigated in the prior action. See generally Johnson v. Union Pac. R.R. Co., 352 Ark. 534, 104 S.W.3d 745 (2003). Neither the record before us nor the Eighth Circuit's opinion in Southern Pine Helicopters, Inc. v. Phoenix Aviation Managers, Inc., supra, indicate that the question of ownership of the salvage was actually litigated in federal court.
