In April 1877 the Dodge City Gang regained control of the mayor's office and Dog Kelly reappointed Deger as town marshal in an effort to pacify the political opposition. He also appointed Ed Masterson as Deger's assistant. In November 1877, Charlie Bassett, Sheriff of Ford County, retired due to term limits and Bat Masterson managed to win election as Sheriff. Bat then hired Bassett as assistant marshal. On April 9, 1878, Ed Masterson was shot and killed by Jack Wagner and Alf Walker. Bassett replaced Ed Masterson and
Wyatt was hired to be assistant marshal. Bassett, Masterson, and Earp, became an effective team and managed to provide the necessary order to ensure that the cowboys could enjoy themselves without unduly disrupting the lives of the law-abiding citizenry. Dodge remained a wide open town, but it's lawmen were well respected. During this period Wyatt took up with Celia Blaylock. Celia was known as Mattie and was probably a prostitute. Wyatt and Mattie lived as husband and wife. He was a respected member of the community and served as deacon of the church, but was seen as a member of the gambling class and was never socially accepted by the upper echelons of society.
In the fall of 1879 Dodge City was changing from a wide open cow town to a more respectable agricultural community. In September Wyatt left Dodge City for the new mining boomtown of Tombstone, Arizona, where he hoped to become an entrepreneur. His brother Jim went along as did their wives. On their way, they stopped off in Prescott, Arizona to pickup Virgil and his family. The three brothers hoped to start a stage line, but upon their arrival in Tombstone, found that others had already established lines. Virgil had been a town constable in Prescott and managed to get appointed Deputy U.S. Marshall resident in Tombstone. Shortly after arriving in town, all three Earps filed mining claims. Wyatt went to work providing security for Wells Fargo and Jim took a job as bartender in one of the saloons. A bit later Morgan Earp joined his brothers in Tombstone. With the exception of Virgil none of the brothers wanted to take up the role of lawman. All, including Virgil, were focused on making money and hoping that they would strike it rich on one of their several mining claims. In September 1880, Doc Holiday and Big Nose Kate arrived in town. Doc took to the gambling tables.
The economy of Tombstone was based on silver, but there was a constant need for inexpensive beef to feed the miners and townspeople. Several of the ranches that sprang up around Tombstone were thought to have been purchasing cattle that had been stolen across the border in Mexico. A constantly shifting group of cowboys known to everyone in town was suspected of being involved in the illegal operation. They were not formally organized, but their most prominent members included Frank and Tom McLaury: Newman Haynes Clanton and his sons, Joseph Issac (Ike), Phineas and Billy; Curley Bill; Pony Deal; and John Ringo. In July 1880 Virgil, Wyatt and Morgan were recruited as part of a posse sent out from Tombstone to retrieve six U.S. Army mules that a witness said had been stolen by the McLaury brothers, Billy Clanton and Pony Deal. The mules were not recovered, but during the ensuing days Virgil was threatened by Frank McLaury. A few days later Charlie Shibell, the Pima County Sheriff, hired Wyatt as his Deputy resident in Tombstone. At the time, Tombstone was part of Pima County. Shibell was resident in Tuscon and it was understood that Wyatt would run his own operations in Tombstone. Many in town were worried about the increased lawlessness and welcomed Wyatt's appointment.
Wyatt was busy in Tombstone and his brothers assisted him as necessary in maintaining order in the unruly community. In October 1880, Tombstone Sheriff Fred White was shot and killed by Curley Bill. Wyatt apprehended Curley but he was later released. White was replaced by Ben Sippy in November 1880. Politics in Tombstone began to polarize. The cowboys were mostly Democrats and the town folk were mostly Republican. There were two newspapers in town. The Epitaph generally took the Republican side and the Nugget was generally the voice of the Democrats. In the November elections, Bob Paul ran against Charlie Shibell for the position of Pima County Sheriff. Wyatt sided with Paul against his boss. Shibell won by a narrow margin, but retained Earp as his deputy. Paul's supporters felt that the election had not been honest and Wyatt resigned as deputy and worked to overturn the results. Shibell appointed Johnny Behan to replace Wyatt. At the end of January 1881 Judge C.G.W. French ruled in Paul's favor. Governor John C. Fremont was in the process of dividing Pima County into two counties - Pima and Cochise. Behan and Wyatt both wanted to be appointed Sheriff of the new county. Behan offered Wyatt the position of under-sheriff if he would agree not to seek the office of sheriff.