Pacific Northwest Grain Companies and the International Longshore and Warehouse Union say they've reached a tentative labor agreement.
Union members must ratify the contract.
The tentative agreement was reached just before midnight Monday.
The deal would affect grain export facilities at the Port of Portland and the Port of Vancouver.
Scot Beckenbaugh, Acting Director of the Federal Mediation and Conciliation Service, say the negotiations went on for more than two years.
"These were difficult and contentious negotiations to be certain," Beckenbaugh says in a statement. "I am grateful for the professionalism and cooperation the parties exhibited in mediation process."
The tentative agreement paves the way for United Grain Corporation to once again start moving grain.
Washington Governor Jay Inslee issued a statement saying "United Grain Company has been notified that state grain inspectors will resume inspections immediately."
Since July, the company's grain terminal at the Port of Vancouver has only made a few shipments.
Washington state grain inspectors stopped crossing the picket line to go to work set up at the port by the International Longshore and Warehouse Union after Inslee announced state patrol officers would no longer escort state grain inspectors to work.
State grain inspectors say at times they've felt unsafe crossing the picket line. So without a police escort, the inspectors said they would no longer cross. But without inspections, it's virtually impossible to ship grain.
Grain inspections have continued at export facilities at Columbia Grain at the Port of Portland. Grain inspections in Oregon are conducted by the US Department of Agriculture's Federal Grain Inspection Service (FIGS).
United Grain at the Port of Vancouver is the largest grain holding facility on the West Coast.
It's one of only nine export terminals that help move grain overseas from Oregon and Washington, and as far east as Idaho, Nebraska, the Dakotas and Minnesota.
This story originally appeared on Oregon Public Broadcasting.