<?xml version="1.0" encoding="UTF-8"?><edgarSubmission xmlns="http://www.sec.gov/edgar/ownership" xmlns:com="http://www.sec.gov/edgar/common">
  <headerData>
    <submissionType>144</submissionType>
    <filerInfo>
      <filer>
        <filerCredentials>
          <cik>0001617033</cik>
          <ccc>XXXXXXXX</ccc>
        </filerCredentials>
      </filer>
      <liveTestFlag>LIVE</liveTestFlag>



    </filerInfo>
  </headerData>
  <formData>
    <issuerInfo>
      <issuerCik>0001201792</issuerCik>
      <issuerName>AMERICAN PUBLIC EDUCATION INC</issuerName>
      <secFileNumber>001-33810</secFileNumber>
      <issuerAddress>
        <com:street1>111 W CONGRESS STREET</com:street1>
        <com:city>CHARLES TOWN</com:city>
        <com:stateOrCountry>WV</com:stateOrCountry>
        <com:zipCode>25414</com:zipCode>
      </issuerAddress>
      <issuerContactPhone>(304) 724-3700</issuerContactPhone>
      <nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>Kurshan Barbara</nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>
      <relationshipsToIssuer>
        <relationshipToIssuer>Director</relationshipToIssuer>
      </relationshipsToIssuer>
    </issuerInfo>
    <securitiesInformation>
      <securitiesClassTitle>common</securitiesClassTitle>
      <brokerOrMarketmakerDetails>
        <name>Wells Fargo Clearing Services</name>
        <address>
          <com:street1>1 North Jefferson Avenue</com:street1>
          <com:city>St. Louis</com:city>
          <com:stateOrCountry>MO</com:stateOrCountry>
          <com:zipCode>63103</com:zipCode>
        </address>
      </brokerOrMarketmakerDetails>
      <noOfUnitsSold>7333</noOfUnitsSold>
      <aggregateMarketValue>53694.42</aggregateMarketValue>
      <noOfUnitsOutstanding>17783615</noOfUnitsOutstanding>
      <approxSaleDate>11/28/2023</approxSaleDate>
      <securitiesExchangeName>Nasdaq</securitiesExchangeName>
    </securitiesInformation>
    <securitiesToBeSold>
      <securitiesClassTitle>common</securitiesClassTitle>
      <acquiredDate>06/12/2016</acquiredDate>
      <natureOfAcquisitionTransaction>compensation</natureOfAcquisitionTransaction>
      <nameOfPersonfromWhomAcquired>Issuer</nameOfPersonfromWhomAcquired>
      <isGiftTransaction>N</isGiftTransaction>
      <amountOfSecuritiesAcquired>2122</amountOfSecuritiesAcquired>
      <paymentDate>06/12/2016</paymentDate>
      <natureOfPayment>N/A</natureOfPayment>
    </securitiesToBeSold>
    <securitiesToBeSold>
      <securitiesClassTitle>common</securitiesClassTitle>
      <acquiredDate>05/12/2017</acquiredDate>
      <natureOfAcquisitionTransaction>compensation</natureOfAcquisitionTransaction>
      <nameOfPersonfromWhomAcquired>Issuer</nameOfPersonfromWhomAcquired>
      <isGiftTransaction>N</isGiftTransaction>
      <amountOfSecuritiesAcquired>1983</amountOfSecuritiesAcquired>
      <paymentDate>05/12/2017</paymentDate>
      <natureOfPayment>N/A</natureOfPayment>
    </securitiesToBeSold>
    <securitiesToBeSold>
      <securitiesClassTitle>common</securitiesClassTitle>
      <acquiredDate>05/10/2020</acquiredDate>
      <natureOfAcquisitionTransaction>compensation</natureOfAcquisitionTransaction>
      <nameOfPersonfromWhomAcquired>Issuer</nameOfPersonfromWhomAcquired>
      <isGiftTransaction>N</isGiftTransaction>
      <amountOfSecuritiesAcquired>2468</amountOfSecuritiesAcquired>
      <paymentDate>05/10/2020</paymentDate>
      <natureOfPayment>N/A</natureOfPayment>
    </securitiesToBeSold>
    <securitiesToBeSold>
      <securitiesClassTitle>common</securitiesClassTitle>
      <acquiredDate>05/21/2022</acquiredDate>
      <natureOfAcquisitionTransaction>compensation</natureOfAcquisitionTransaction>
      <nameOfPersonfromWhomAcquired>Issuer</nameOfPersonfromWhomAcquired>
      <isGiftTransaction>N</isGiftTransaction>
      <amountOfSecuritiesAcquired>2845</amountOfSecuritiesAcquired>
      <paymentDate>05/21/2022</paymentDate>
      <natureOfPayment>N/A</natureOfPayment>
    </securitiesToBeSold>
    <securitiesToBeSold>
      <securitiesClassTitle>common</securitiesClassTitle>
      <acquiredDate>06/01/2022</acquiredDate>
      <natureOfAcquisitionTransaction>compensation</natureOfAcquisitionTransaction>
      <nameOfPersonfromWhomAcquired>Issuer</nameOfPersonfromWhomAcquired>
      <isGiftTransaction>N</isGiftTransaction>
      <amountOfSecuritiesAcquired>2520</amountOfSecuritiesAcquired>
      <paymentDate>06/01/2022</paymentDate>
      <natureOfPayment>N/A</natureOfPayment>
    </securitiesToBeSold>
    <nothingToReportFlagOnSecuritiesSoldInPast3Months>N</nothingToReportFlagOnSecuritiesSoldInPast3Months>
    <securitiesSoldInPast3Months>
      <sellerDetails>
        <name>Barbara Lynn Kurshan Living Trust, Barbara Lynn Kurshan, TTEE</name>
        <address>
          <com:street1>111 West Congress Street</com:street1>
          <com:city>Charles Town</com:city>
          <com:stateOrCountry>WV</com:stateOrCountry>
          <com:zipCode>25414</com:zipCode>
        </address>
      </sellerDetails>
      <securitiesClassTitle>American Public Education, Inc.</securitiesClassTitle>
      <saleDate>11/27/2023</saleDate>
      <amountOfSecuritiesSold>4605</amountOfSecuritiesSold>
      <grossProceeds>32089.61</grossProceeds>
    </securitiesSoldInPast3Months>
    <remarks>shares were sold in account for Barbara Lynn Kurshan Living Trust, Barbara Lynn Kurshan as trustee</remarks>
    <noticeSignature>
      <noticeDate>11/28/2023</noticeDate>
      <signature>Barbara Lynn Kurshan</signature>
    </noticeSignature>
  </formData>
</edgarSubmission>
[{"type": "144", "sequence": "1", "filename": "primary_doc.xml", "secsgml_size_bytes": 5579}]
144
0001617033
XXXXXXXX
LIVE
0001201792
AMERICAN PUBLIC EDUCATION INC
001-33810
111 W CONGRESS STREET
CHARLES TOWN
WV
25414
(304) 724-3700
Kurshan Barbara
Director
common
Wells Fargo Clearing Services
1 North Jefferson Avenue
St. Louis
MO
63103
7333
53694.42
17783615
11/28/2023
Nasdaq
common
06/12/2016
compensation
Issuer
N
2122
06/12/2016
N/A
common
05/12/2017
compensation
Issuer
N
1983
05/12/2017
N/A
common
05/10/2020
compensation
Issuer
N
2468
05/10/2020
N/A
common
05/21/2022
compensation
Issuer
N
2845
05/21/2022
N/A
common
06/01/2022
compensation
Issuer
N
2520
06/01/2022
N/A
N
Barbara Lynn Kurshan Living Trust, Barbara Lynn Kurshan, TTEE
111 West Congress Street
Charles Town
WV
25414
American Public Education, Inc.
11/27/2023
4605
32089.61
shares were sold in account for Barbara Lynn Kurshan Living Trust, Barbara Lynn Kurshan as trustee
11/28/2023
Barbara Lynn Kurshan